Skip to content

Commit 666a095

Browse files
authored
kernel: bring up hi3519dv500 (V5 aarch64) — open_*.ko from vendor SDK (#204)
Port the Hi3519DV500/Hi3516DV500 (V5/SS626, aarch64 Cortex-A55) kernel modules, mirroring the hi3516cv6xx (V5 armv7) bring-up. 53 open_*.ko build against openipc/linux 5.10.0 with the aarch64-openipc-linux-musl toolchain: - OSAL, MMZ, sys_config: full vendor source. - 42 blob modules: vendor closed .o payloads (obj/hi3519dv500/hi_*.o from out/obj/mod_*.o) + vendor init wrappers (init/hi3519dv500/*_init.c). - Peripherals from source: wdt, adc, sensor_i2c, sensor_spi, pwm, piris, user, mipi_rx. aarch64 specifics: - kernel/Kbuild sets -DUSER_BIT_64/-DKERNEL_BIT_64 for hi3519dv500 (the 32-bit families keep the historical default). - mipi_rx_hal.c: rename the file-local static set_bit() that clashed with the arm64 asm/bitops.h set_bit(). sensor_i2c/spi/pwm/piris aren't standalone .ko in the vendor SDK; they are made standalone via init wrappers shared with cv6xx (same V5 driver API). Deferred (match cv6xx): cipher/km/otp/hardware_cryptodev/gfbg/mipi_tx. Vendor .o blobs are force-added (.gitignore excludes *.o).
1 parent 913e7eb commit 666a095

490 files changed

Lines changed: 125921 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Replaces the proprietary SDK that HiSilicon ships to camera manufacturers. Used
1717
| V4 | hi3516ev200 | hi3516ev200, hi3516ev300, hi3518ev300, hi3516dv200 | Cortex-A7 | `hi3516ev200` |
1818
| V4/Goke | gk7205v200 | gk7205v200, gk7205v300, gk7202v300, gk7605v100 | Cortex-A7 | `gk7205v200` |
1919
| V5 | hi3516cv610 | hi3516cv610, hi3516cv608 | Cortex-A7 | `hi3516cv6xx` |
20+
| V5 | hi3519dv500 | hi3519dv500, hi3516dv500 | Cortex-A55 (aarch64) | `hi3519dv500` |
2021

2122
Generation labels match [qemu-hisilicon](https://github.com/widgetii/qemu-hisilicon). The hi3516ev200 and gk7205v200 are pin-compatible — the same source compiles for both via `CHIPARCH`. A [conversion script](scripts/hi2gk.sh) translates between HiSilicon and Goke naming.
2223

@@ -52,6 +53,7 @@ The generation **number** tracks the peripheral address map and SDK architecture
5253
| V3.5 | CV500 | Cortex-A7 | OSAL | Raw `.o` + init wrappers | Incremental V3, snake_case SDK symbols |
5354
| V4 | EV200 | Cortex-A7 | OSAL | Source-based Kbuild | Redesigned modular SDK, Goke compat, mainline kernel |
5455
| V5 | CV610 | Cortex-A7 | OSAL + MMZ split | Raw `.o` + vendor init wrappers | Hi3516CV610/CV608, MMZ separated from OSAL again, vendor ships init wrappers as source |
56+
| V5 | DV500 | Cortex-A55 (aarch64) | OSAL + MMZ split | Raw `.o` + vendor init wrappers | Hi3519DV500/Hi3516DV500, 64-bit ABI (`-DUSER_BIT_64/-DKERNEL_BIT_64`), 53 modules (42 blob + OSAL/MMZ/sys_config + peripherals + mipi_rx) |
5557

5658
### Dealing with vendor .ko blobs
5759

@@ -90,6 +92,7 @@ No `#ifdef` soup in driver code — the compat header handles everything. This i
9092
| 3.18.20 (vendor) | Production | hi3516cv300, hi3519v101 |
9193
| 4.9.37 (vendor) | Production | hi3516cv200, hi3516av100, hi3516cv500, hi3516ev300, gk7205v200 |
9294
| 5.10.221 (vendor) | Production | hi3516cv6xx |
95+
| 5.10.0 (vendor) | Production | hi3519dv500 |
9396
| 6.6 LTS | Production | hi3516ev300 (neo) |
9497
| 6.18 LTS | Tested | hi3516ev300 (CI-verified) |
9598
| 7.0-rc6 (mainline) | Production | hi3516ev300 (neo) |
@@ -105,6 +108,7 @@ No `#ifdef` soup in driver code — the compat header handles everything. This i
105108
│ ├── hi3516av100.kbuild V2A monolithic build config
106109
│ ├── hi3519v101.kbuild V3A monolithic build config (OSAL)
107110
│ ├── hi3516cv6xx.kbuild V5 monolithic build config (OSAL + MMZ split)
111+
│ ├── hi3519dv500.kbuild V5 aarch64 build config (64-bit, OSAL + MMZ split)
108112
│ ├── Kbuild Main entry — dispatches by CHIPARCH
109113
│ ├── compat/ Kernel version compatibility (3.0 – 7.0)
110114
│ ├── obj/<chiparch>/ Pre-built vendor .o blobs

kernel/Kbuild

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ ifeq ($(CHIPARCH),)
44
@echo CHIPARCH must be set
55
endif
66

7-
ccflags-y := -D$(CHIPARCH) -DRELEASE -DUSER_BIT_32 -DKERNEL_BIT_32 -Wno-date-time -D_GNU_SOURCE
7+
# aarch64 SoCs (e.g. hi3519dv500) build a 64-bit kernel/userspace ABI; the
8+
# 32-bit families keep the historical default.
9+
OT_BIT_WIDTH := 32
10+
ifeq ($(CHIPARCH),hi3519dv500)
11+
OT_BIT_WIDTH := 64
12+
endif
13+
ccflags-y := -D$(CHIPARCH) -DRELEASE -DUSER_BIT_$(OT_BIT_WIDTH) -DKERNEL_BIT_$(OT_BIT_WIDTH) -Wno-date-time -D_GNU_SOURCE
814
ccflags-y += -include $(src)/compat/kernel_compat.h
915
# Re-add GCC's built-in include dir (stdarg.h etc.) stripped by -nostdinc in 5.15+
1016
ccflags-y += -isystem $(shell $(CC) -print-file-name=include)
@@ -26,6 +32,8 @@ else ifeq ($(CHIPARCH),hi3520dv200)
2632
include $(src)/hi3520dv200.kbuild
2733
else ifeq ($(CHIPARCH),hi3516cv6xx)
2834
include $(src)/hi3516cv6xx.kbuild
35+
else ifeq ($(CHIPARCH),hi3519dv500)
36+
include $(src)/hi3519dv500.kbuild
2937
else
3038

3139
ccflags-y += -I$(src)/../include

0 commit comments

Comments
 (0)