Skip to content

Commit 3ec468f

Browse files
committed
sunxi: add F1C100 (arm926ej-s) support
This is Allwinner's ARM926EJ-S core, which is one of its early products, reappearing in recent compact designs. The SoC includes 32/64Mb memory in the same physical package, and has display and USB interfaces, allowing for very small footprint boards. The target consists of basic 6.12 support, with u-boot. Instead of creating a separate suniv target, as both the kernel and u-boot supports enough of this SoC by now with minimal patching, add it into sunxi as a subtarget. Link: openwrt/openwrt#15022 Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
1 parent 09ae2da commit 3ec468f

File tree

13 files changed

+342
-4
lines changed

13 files changed

+342
-4
lines changed

package/boot/uboot-sunxi/Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ define U-Boot/OLIMEX_A13_SOM
140140
BUILD_DEVICES:=olimex_a13-olimex-som
141141
endef
142142

143+
define U-Boot/licheepi_nano
144+
BUILD_SUBTARGET:=arm926ejs
145+
NAME:=LicheePi Nano
146+
UENV:=f1c
147+
BUILD_DEVICES:=licheepi-nano
148+
endef
149+
143150
define U-Boot/Linksprite_pcDuino
144151
BUILD_SUBTARGET:=cortexa8
145152
NAME:=Linksprite pcDuino
@@ -257,6 +264,13 @@ define U-Boot/pangolin
257264
UENV:=pangolin
258265
endef
259266

267+
define U-Boot/popstick
268+
BUILD_SUBTARGET:=arm926ejs
269+
NAME:=PopStick
270+
UENV:=f1c
271+
BUILD_DEVICES:=popstick-v1.1
272+
endef
273+
260274
define U-Boot/libretech_all_h3_cc_h5
261275
BUILD_SUBTARGET:=cortexa53
262276
NAME:=Libre Computer ALL-H3-CC H5
@@ -323,7 +337,6 @@ define U-Boot/sopine_baseboard
323337
ATF:=a64
324338
endef
325339

326-
327340
define U-Boot/orangepi_zero_plus
328341
BUILD_SUBTARGET:=cortexa53
329342
NAME:=Xunlong Orange Pi Zero Plus
@@ -411,6 +424,7 @@ UBOOT_TARGETS := \
411424
Marsboard_A10 \
412425
Mele_M9 \
413426
OLIMEX_A13_SOM \
427+
licheepi_nano \
414428
LicheePi_Zero \
415429
Linksprite_pcDuino \
416430
Linksprite_pcDuino3 \
@@ -437,6 +451,7 @@ UBOOT_TARGETS := \
437451
orangepi_zero2w \
438452
orangepi_zero3 \
439453
pangolin \
454+
popstick \
440455
pine64_plus \
441456
Sinovoip_BPI_M3 \
442457
sopine_baseboard \
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
From 08d194d881e10e09cba7551da8079734d89ed16d Mon Sep 17 00:00:00 2001
2+
From: Icenowy Zheng <uwu@icenowy.me>
3+
Date: Thu, 16 Jun 2022 00:28:41 +0800
4+
Subject: [PATCH 1/2] add USB support and PopStick support
5+
6+
Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
7+
---
8+
arch/arm/dts/Makefile | 3 +-
9+
arch/arm/dts/suniv-f1c100s-licheepi-nano.dts | 16 ++++
10+
arch/arm/dts/suniv-f1c100s.dtsi | 26 ++++++
11+
arch/arm/dts/suniv-f1c200s-popstick.dts | 89 ++++++++++++++++++++
12+
drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++
13+
drivers/usb/musb-new/sunxi.c | 6 ++
14+
6 files changed, 153 insertions(+), 1 deletion(-)
15+
create mode 100644 arch/arm/dts/suniv-f1c200s-popstick.dts
16+
17+
--- a/arch/arm/dts/Makefile
18+
+++ b/arch/arm/dts/Makefile
19+
@@ -647,7 +647,8 @@ dtb-$(CONFIG_STM32H7) += stm32h743i-disc
20+
stm32h750i-art-pi.dtb
21+
22+
dtb-$(CONFIG_MACH_SUNIV) += \
23+
- suniv-f1c100s-licheepi-nano.dtb
24+
+ suniv-f1c100s-licheepi-nano.dtb \
25+
+ suniv-f1c200s-popstick.dtb
26+
dtb-$(CONFIG_MACH_SUN4I) += \
27+
sun4i-a10-a1000.dtb \
28+
sun4i-a10-ba10-tvbox.dtb \
29+
--- /dev/null
30+
+++ b/arch/arm/dts/suniv-f1c200s-popstick.dts
31+
@@ -0,0 +1,89 @@
32+
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
33+
+/*
34+
+ * Copyright 2022 Icenowy Zheng <uwu@icenowy.me>
35+
+ */
36+
+
37+
+/dts-v1/;
38+
+#include "suniv-f1c100s.dtsi"
39+
+
40+
+#include <dt-bindings/gpio/gpio.h>
41+
+
42+
+/ {
43+
+ model = "Popcorn Computer PopStick";
44+
+ compatible = "sourceparts,popstick", "allwinner,suniv-f1c200s",
45+
+ "allwinner,suniv-f1c100s";
46+
+
47+
+ aliases {
48+
+ mmc0 = &mmc0;
49+
+ serial0 = &uart0;
50+
+ spi0 = &spi0;
51+
+ };
52+
+
53+
+ chosen {
54+
+ stdout-path = "serial0:115200n8";
55+
+ };
56+
+
57+
+ reg_vcc3v3: vcc3v3 {
58+
+ compatible = "regulator-fixed";
59+
+ regulator-name = "vcc3v3";
60+
+ regulator-min-microvolt = <3300000>;
61+
+ regulator-max-microvolt = <3300000>;
62+
+ };
63+
+};
64+
+
65+
+&mmc0 {
66+
+ broken-cd;
67+
+ bus-width = <4>;
68+
+ disable-wp;
69+
+ status = "okay";
70+
+ vmmc-supply = <&reg_vcc3v3>;
71+
+};
72+
+
73+
+&spi0 {
74+
+ pinctrl-names = "default";
75+
+ pinctrl-0 = <&spi0_pc_pins>;
76+
+ status = "okay";
77+
+
78+
+ flash@0 {
79+
+ #address-cells = <1>;
80+
+ #size-cells = <1>;
81+
+ compatible = "spi-nand";
82+
+ reg = <0>;
83+
+ spi-max-frequency = <1000000>;
84+
+
85+
+ partitions {
86+
+ compatible = "fixed-partitions";
87+
+ #address-cells = <1>;
88+
+ #size-cells = <1>;
89+
+
90+
+ partition@0 {
91+
+ label = "u-boot-with-spl";
92+
+ reg = <0x0 0x100000>;
93+
+ };
94+
+
95+
+ ubi@100000 {
96+
+ label = "ubi";
97+
+ reg = <0x100000 0x7f00000>;
98+
+ };
99+
+ };
100+
+ };
101+
+};
102+
+
103+
+&otg_sram {
104+
+ status = "okay";
105+
+};
106+
+
107+
+&uart0 {
108+
+ pinctrl-names = "default";
109+
+ pinctrl-0 = <&uart0_pe_pins>;
110+
+ status = "okay";
111+
+};
112+
+
113+
+&usb_otg {
114+
+ dr_mode = "peripheral";
115+
+ status = "okay";
116+
+};
117+
+
118+
+&usbphy {
119+
+ status = "okay";
120+
+};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
From 0d263e1071ee3f63d2047a8bb9af4434f1cd4bb1 Mon Sep 17 00:00:00 2001
2+
From: Icenowy Zheng <uwu@icenowy.me>
3+
Date: Thu, 16 Jun 2022 09:46:42 +0800
4+
Subject: [PATCH 2/2] HACK for UBI env and add defconfig
5+
6+
---
7+
board/sunxi/board.c | 1 +
8+
configs/popstick_defconfig | 37 +++++++++++++++++++++++++++++++++++++
9+
2 files changed, 38 insertions(+)
10+
create mode 100644 configs/popstick_defconfig
11+
12+
--- /dev/null
13+
+++ b/configs/popstick_defconfig
14+
@@ -0,0 +1,37 @@
15+
+CONFIG_ARM=y
16+
+CONFIG_SKIP_LOWLEVEL_INIT_ONLY=y
17+
+CONFIG_SPL_SKIP_LOWLEVEL_INIT_ONLY=y
18+
+CONFIG_ARCH_SUNXI=y
19+
+CONFIG_ENV_SIZE=0x1f000
20+
+CONFIG_DEFAULT_DEVICE_TREE="suniv-f1c200s-popstick"
21+
+CONFIG_SPL=y
22+
+CONFIG_MACH_SUNIV=y
23+
+CONFIG_DRAM_CLK=156
24+
+CONFIG_DRAM_ZQ=0
25+
+# CONFIG_VIDEO_SUNXI is not set
26+
+CONFIG_SPL_SPI_SUNXI=y
27+
+CONFIG_SPL_SPI_SUNXI_NAND=y
28+
+CONFIG_SPL_SPI_SUNXI_NAND_ASSUMED_PAGESIZE=0x800
29+
+# CONFIG_ANDROID_BOOT_IMAGE is not set
30+
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000
31+
+CONFIG_CMD_MTD=y
32+
+# CONFIG_CMD_SF is not set
33+
+CONFIG_CMD_MTDPARTS=y
34+
+CONFIG_CMD_UBI=y
35+
+# CONFIG_ENV_IS_IN_FAT is not set
36+
+# CONFIG_ENV_IS_IN_SPI_FLASH is not set
37+
+CONFIG_ENV_IS_IN_UBI=y
38+
+CONFIG_ENV_UBI_PART="ubi"
39+
+CONFIG_ENV_UBI_VOLUME="env"
40+
+# CONFIG_NET is not set
41+
+CONFIG_MTD=y
42+
+CONFIG_DM_MTD=y
43+
+CONFIG_MTD_SPI_NAND=y
44+
+# CONFIG_SPI_FLASH is not set
45+
+CONFIG_SF_DEFAULT_SPEED=25000000
46+
+# CONFIG_UBI_SILENCE_MSG is not set
47+
+CONFIG_PHY_SUN4I_USB=y
48+
+CONFIG_SPI=y
49+
+CONFIG_USB_MUSB_GADGET=y
50+
+CONFIG_USB_FUNCTION_SDP=y
51+
+# CONFIG_UBIFS_SILENCE_MSG is not set
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
setenv mmc_rootpart 2
2+
part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid
3+
setenv loadkernel fatload mmc \$mmc_bootdev \$ramdisk_addr_r uImage
4+
setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait
5+
setenv uenvcmd run loadkernel \&\& bootm \$ramdisk_addr_r
6+
run uenvcmd

target/linux/sunxi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ARCH:=arm
88
BOARD:=sunxi
99
BOARDNAME:=Allwinner ARM SoCs
1010
FEATURES:=ext4 display ramdisk rootfs-part rtc squashfs usb usbgadget
11-
SUBTARGETS:=cortexa8 cortexa7 cortexa53
11+
SUBTARGETS:=cortexa8 cortexa7 cortexa53 arm926ejs
1212

1313
KERNEL_PATCHVER:=6.12
1414

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# CONFIG_ARCH_MULTI_V4 is not set
2+
# CONFIG_ARCH_MULTI_V4T is not set
3+
CONFIG_ARCH_MULTI_V4_V5=y
4+
CONFIG_ARCH_MULTI_V5=y
5+
CONFIG_ARCH_MULTIPLATFORM=y
6+
CONFIG_ARCH_MULTI_CPU_AUTO=y
7+
CONFIG_ARCH_NR_GPIO=416
8+
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
9+
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
10+
CONFIG_ARCH_SPARSEMEM_ENABLE=y
11+
CONFIG_ARCH_SUNXI=y
12+
CONFIG_ARCH_32BIT_OFF_T=y
13+
CONFIG_ARCH_HAS_BINFMT_FLAT=y
14+
CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y
15+
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
16+
CONFIG_COMPAT_32BIT_TIME=y
17+
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
18+
# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
19+
CONFIG_MACH_SUNIV=y
20+
# CONFIG_MACH_SUN4I is not set
21+
# CONFIG_MACH_SUN5I is not set
22+
# CONFIG_MACH_SUN6I is not set
23+
# CONFIG_MACH_SUN7I is not set
24+
# CONFIG_MACH_SUN8I is not set
25+
# CONFIG_MACH_SUN9I is not set
26+
CONFIG_MDIO_BUS_MUX=y
27+
CONFIG_MTD_SPI_NAND=y
28+
CONFIG_MUSB_PIO_ONLY=y
29+
CONFIG_NOP_USB_XCEIV=y
30+
# CONFIG_PHY_SUN9I_USB is not set
31+
# CONFIG_PINCTRL_SUN4I_A10 is not set
32+
# CONFIG_PINCTRL_SUN50I_A64 is not set
33+
# CONFIG_PINCTRL_SUN50I_A64_R is not set
34+
# CONFIG_PINCTRL_SUN50I_H5 is not set
35+
# CONFIG_PINCTRL_SUN50I_H6 is not set
36+
# CONFIG_PINCTRL_SUN50I_H6_R is not set
37+
# CONFIG_PINCTRL_SUN5I is not set
38+
# CONFIG_PINCTRL_SUN6I_A31 is not set
39+
# CONFIG_PINCTRL_SUN6I_A31_R is not set
40+
# CONFIG_PINCTRL_SUN8I_A23 is not set
41+
# CONFIG_PINCTRL_SUN8I_A23_R is not set
42+
# CONFIG_PINCTRL_SUN8I_A33 is not set
43+
# CONFIG_PINCTRL_SUN8I_A83T is not set
44+
# CONFIG_PINCTRL_SUN8I_A83T_R is not set
45+
# CONFIG_PINCTRL_SUN8I_H3 is not set
46+
# CONFIG_PINCTRL_SUN8I_H3_R is not set
47+
# CONFIG_PINCTRL_SUN8I_V3S is not set
48+
# CONFIG_PINCTRL_SUN9I_A80 is not set
49+
# CONFIG_PINCTRL_SUN9I_A80_R is not set
50+
CONFIG_PINCTRL_SUNIV_F1C100S=y
51+
CONFIG_PINCTRL_SUNXI=y
52+
CONFIG_SUNIV_F1C100S_CCU=y
53+
CONFIG_UNWINDER_ARM=y
54+
CONFIG_USB_MUSB_HDRC=y
55+
CONFIG_USB_MUSB_DUAL_ROLE=y
56+
CONFIG_USB_MUSB_SUNXI=y
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#
2+
# Copyright (C) 2024 Zoltan HERPAI
3+
#
4+
# This is free software, licensed under the GNU General Public License v2.
5+
# See /LICENSE for more information.
6+
#
7+
8+
include $(TOPDIR)/rules.mk
9+
10+
BOARDNAME:=Allwinner F1C100/200s
11+
CPU_TYPE:=arm926ej-s

target/linux/sunxi/config-6.12

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ CONFIG_ARCH_HIBERNATION_POSSIBLE=y
77
CONFIG_ARCH_KEEP_MEMBLOCK=y
88
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
99
CONFIG_ARCH_MULTIPLATFORM=y
10-
CONFIG_ARCH_MULTI_V6_V7=y
11-
CONFIG_ARCH_MULTI_V7=y
1210
CONFIG_ARCH_NR_GPIO=416
1311
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
1412
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y

target/linux/sunxi/cortexa7/config-6.12

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CONFIG_ARCH_MULTI_V6_V7=y
2+
CONFIG_ARCH_MULTI_V7=y
13
CONFIG_B53=y
24
CONFIG_B53_MDIO_DRIVER=y
35
CONFIG_CRYPTO_BLAKE2S_ARM=y

target/linux/sunxi/cortexa8/config-6.12

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CONFIG_ARCH_MULTI_V6_V7=y
2+
CONFIG_ARCH_MULTI_V7=y
13
# CONFIG_ARM_LPAE is not set
24
CONFIG_CRYPTO_BLAKE2S_ARM=y
35
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y

0 commit comments

Comments
 (0)