forked from openwrt/openwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.1 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, let's add it into sunxi as a subtarget. Signed-off-by: Zoltan HERPAI <[email protected]>
- Loading branch information
Showing
15 changed files
with
568 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
package/boot/uboot-sunxi/patches/260-sunxi-add-USB-support-and-PopStick-support.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
From 08d194d881e10e09cba7551da8079734d89ed16d Mon Sep 17 00:00:00 2001 | ||
From: Icenowy Zheng <[email protected]> | ||
Date: Thu, 16 Jun 2022 00:28:41 +0800 | ||
Subject: [PATCH 1/2] add USB support and PopStick support | ||
|
||
Signed-off-by: Icenowy Zheng <[email protected]> | ||
--- | ||
arch/arm/dts/Makefile | 3 +- | ||
arch/arm/dts/suniv-f1c100s-licheepi-nano.dts | 16 ++++ | ||
arch/arm/dts/suniv-f1c100s.dtsi | 26 ++++++ | ||
arch/arm/dts/suniv-f1c200s-popstick.dts | 89 ++++++++++++++++++++ | ||
drivers/phy/allwinner/phy-sun4i-usb.c | 14 +++ | ||
drivers/usb/musb-new/sunxi.c | 6 ++ | ||
6 files changed, 153 insertions(+), 1 deletion(-) | ||
create mode 100644 arch/arm/dts/suniv-f1c200s-popstick.dts | ||
|
||
--- a/arch/arm/dts/Makefile | ||
+++ b/arch/arm/dts/Makefile | ||
@@ -647,7 +647,8 @@ dtb-$(CONFIG_STM32H7) += stm32h743i-disc | ||
stm32h750i-art-pi.dtb | ||
|
||
dtb-$(CONFIG_MACH_SUNIV) += \ | ||
- suniv-f1c100s-licheepi-nano.dtb | ||
+ suniv-f1c100s-licheepi-nano.dtb \ | ||
+ suniv-f1c200s-popstick.dtb | ||
dtb-$(CONFIG_MACH_SUN4I) += \ | ||
sun4i-a10-a1000.dtb \ | ||
sun4i-a10-ba10-tvbox.dtb \ | ||
--- /dev/null | ||
+++ b/arch/arm/dts/suniv-f1c200s-popstick.dts | ||
@@ -0,0 +1,89 @@ | ||
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT) | ||
+/* | ||
+ * Copyright 2022 Icenowy Zheng <[email protected]> | ||
+ */ | ||
+ | ||
+/dts-v1/; | ||
+#include "suniv-f1c100s.dtsi" | ||
+ | ||
+#include <dt-bindings/gpio/gpio.h> | ||
+ | ||
+/ { | ||
+ model = "Popcorn Computer PopStick"; | ||
+ compatible = "sourceparts,popstick", "allwinner,suniv-f1c200s", | ||
+ "allwinner,suniv-f1c100s"; | ||
+ | ||
+ aliases { | ||
+ mmc0 = &mmc0; | ||
+ serial0 = &uart0; | ||
+ spi0 = &spi0; | ||
+ }; | ||
+ | ||
+ chosen { | ||
+ stdout-path = "serial0:115200n8"; | ||
+ }; | ||
+ | ||
+ reg_vcc3v3: vcc3v3 { | ||
+ compatible = "regulator-fixed"; | ||
+ regulator-name = "vcc3v3"; | ||
+ regulator-min-microvolt = <3300000>; | ||
+ regulator-max-microvolt = <3300000>; | ||
+ }; | ||
+}; | ||
+ | ||
+&mmc0 { | ||
+ broken-cd; | ||
+ bus-width = <4>; | ||
+ disable-wp; | ||
+ status = "okay"; | ||
+ vmmc-supply = <®_vcc3v3>; | ||
+}; | ||
+ | ||
+&spi0 { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&spi0_pc_pins>; | ||
+ status = "okay"; | ||
+ | ||
+ flash@0 { | ||
+ #address-cells = <1>; | ||
+ #size-cells = <1>; | ||
+ compatible = "spi-nand"; | ||
+ reg = <0>; | ||
+ spi-max-frequency = <1000000>; | ||
+ | ||
+ partitions { | ||
+ compatible = "fixed-partitions"; | ||
+ #address-cells = <1>; | ||
+ #size-cells = <1>; | ||
+ | ||
+ partition@0 { | ||
+ label = "u-boot-with-spl"; | ||
+ reg = <0x0 0x100000>; | ||
+ }; | ||
+ | ||
+ ubi@100000 { | ||
+ label = "ubi"; | ||
+ reg = <0x100000 0x7f00000>; | ||
+ }; | ||
+ }; | ||
+ }; | ||
+}; | ||
+ | ||
+&otg_sram { | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&uart0 { | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&uart0_pe_pins>; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&usb_otg { | ||
+ dr_mode = "peripheral"; | ||
+ status = "okay"; | ||
+}; | ||
+ | ||
+&usbphy { | ||
+ status = "okay"; | ||
+}; |
61 changes: 61 additions & 0 deletions
61
package/boot/uboot-sunxi/patches/261-sunxi-add-popstick-defconfig.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
From 0d263e1071ee3f63d2047a8bb9af4434f1cd4bb1 Mon Sep 17 00:00:00 2001 | ||
From: Icenowy Zheng <[email protected]> | ||
Date: Thu, 16 Jun 2022 09:46:42 +0800 | ||
Subject: [PATCH 2/2] HACK for UBI env and add defconfig | ||
|
||
--- | ||
board/sunxi/board.c | 1 + | ||
configs/popstick_defconfig | 37 +++++++++++++++++++++++++++++++++++++ | ||
2 files changed, 38 insertions(+) | ||
create mode 100644 configs/popstick_defconfig | ||
|
||
--- a/board/sunxi/board.c | ||
+++ b/board/sunxi/board.c | ||
@@ -135,6 +135,7 @@ void i2c_init_board(void) | ||
*/ | ||
enum env_location env_get_location(enum env_operation op, int prio) | ||
{ | ||
+ return prio ? ENVL_UNKNOWN : ENVL_UBI; | ||
if (prio > 1) | ||
return ENVL_UNKNOWN; | ||
|
||
--- /dev/null | ||
+++ b/configs/popstick_defconfig | ||
@@ -0,0 +1,37 @@ | ||
+CONFIG_ARM=y | ||
+CONFIG_SKIP_LOWLEVEL_INIT_ONLY=y | ||
+CONFIG_SPL_SKIP_LOWLEVEL_INIT_ONLY=y | ||
+CONFIG_ARCH_SUNXI=y | ||
+CONFIG_ENV_SIZE=0x1f000 | ||
+CONFIG_DEFAULT_DEVICE_TREE="suniv-f1c200s-popstick" | ||
+CONFIG_SPL=y | ||
+CONFIG_MACH_SUNIV=y | ||
+CONFIG_DRAM_CLK=156 | ||
+CONFIG_DRAM_ZQ=0 | ||
+# CONFIG_VIDEO_SUNXI is not set | ||
+CONFIG_SPL_SPI_SUNXI=y | ||
+CONFIG_SPL_SPI_SUNXI_NAND=y | ||
+CONFIG_SPL_SPI_SUNXI_NAND_ASSUMED_PAGESIZE=0x800 | ||
+# CONFIG_ANDROID_BOOT_IMAGE is not set | ||
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x20000 | ||
+CONFIG_CMD_MTD=y | ||
+# CONFIG_CMD_SF is not set | ||
+CONFIG_CMD_MTDPARTS=y | ||
+CONFIG_CMD_UBI=y | ||
+# CONFIG_ENV_IS_IN_FAT is not set | ||
+# CONFIG_ENV_IS_IN_SPI_FLASH is not set | ||
+CONFIG_ENV_IS_IN_UBI=y | ||
+CONFIG_ENV_UBI_PART="ubi" | ||
+CONFIG_ENV_UBI_VOLUME="env" | ||
+# CONFIG_NET is not set | ||
+CONFIG_MTD=y | ||
+CONFIG_DM_MTD=y | ||
+CONFIG_MTD_SPI_NAND=y | ||
+# CONFIG_SPI_FLASH is not set | ||
+CONFIG_SF_DEFAULT_SPEED=25000000 | ||
+# CONFIG_UBI_SILENCE_MSG is not set | ||
+CONFIG_PHY_SUN4I_USB=y | ||
+CONFIG_SPI=y | ||
+CONFIG_USB_MUSB_GADGET=y | ||
+CONFIG_USB_FUNCTION_SDP=y | ||
+# CONFIG_UBIFS_SILENCE_MSG is not set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# CONFIG_ARCH_MULTI_V4 is not set | ||
# CONFIG_ARCH_MULTI_V4T is not set | ||
CONFIG_ARCH_MULTI_V4_V5=y | ||
CONFIG_ARCH_MULTI_V5=y | ||
CONFIG_ARCH_MULTIPLATFORM=y | ||
CONFIG_ARCH_MULTI_CPU_AUTO=y | ||
CONFIG_ARCH_NR_GPIO=416 | ||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y | ||
CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
CONFIG_ARCH_SPARSEMEM_ENABLE=y | ||
CONFIG_ARCH_SUNXI=y | ||
CONFIG_ARCH_32BIT_OFF_T=y | ||
CONFIG_ARCH_HAS_BINFMT_FLAT=y | ||
CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y | ||
CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y | ||
CONFIG_COMPAT_32BIT_TIME=y | ||
# CONFIG_CPU_DCACHE_WRITETHROUGH is not set | ||
# CONFIG_CPU_CACHE_ROUND_ROBIN is not set | ||
CONFIG_MACH_SUNIV=y | ||
# CONFIG_MACH_SUN4I is not set | ||
# CONFIG_MACH_SUN5I is not set | ||
# CONFIG_MACH_SUN6I is not set | ||
# CONFIG_MACH_SUN7I is not set | ||
# CONFIG_MACH_SUN8I is not set | ||
# CONFIG_MACH_SUN9I is not set | ||
CONFIG_MDIO_BUS_MUX=y | ||
CONFIG_MUSB_PIO_ONLY=y | ||
# CONFIG_PHY_SUN9I_USB is not set | ||
# CONFIG_PINCTRL_SUN4I_A10 is not set | ||
# CONFIG_PINCTRL_SUN50I_A64 is not set | ||
# CONFIG_PINCTRL_SUN50I_A64_R is not set | ||
# CONFIG_PINCTRL_SUN50I_H5 is not set | ||
# CONFIG_PINCTRL_SUN50I_H6 is not set | ||
# CONFIG_PINCTRL_SUN50I_H6_R is not set | ||
# CONFIG_PINCTRL_SUN5I is not set | ||
# CONFIG_PINCTRL_SUN6I_A31 is not set | ||
# CONFIG_PINCTRL_SUN6I_A31_R is not set | ||
# CONFIG_PINCTRL_SUN8I_A23 is not set | ||
# CONFIG_PINCTRL_SUN8I_A23_R is not set | ||
# CONFIG_PINCTRL_SUN8I_A33 is not set | ||
# CONFIG_PINCTRL_SUN8I_A83T is not set | ||
# CONFIG_PINCTRL_SUN8I_A83T_R is not set | ||
# CONFIG_PINCTRL_SUN8I_H3 is not set | ||
# CONFIG_PINCTRL_SUN8I_H3_R is not set | ||
# CONFIG_PINCTRL_SUN8I_V3S is not set | ||
# CONFIG_PINCTRL_SUN9I_A80 is not set | ||
# CONFIG_PINCTRL_SUN9I_A80_R is not set | ||
CONFIG_PINCTRL_SUNIV_F1C100S=y | ||
CONFIG_PINCTRL_SUNXI=y | ||
CONFIG_SUNIV_F1C100S_CCU=y | ||
CONFIG_UNWINDER_ARM=y | ||
CONFIG_USB_MUSB_HDRC=y | ||
CONFIG_USB_MUSB_DUAL_ROLE=y | ||
CONFIG_USB_MUSB_SUNXI=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (C) 2024 Zoltan HERPAI | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
BOARDNAME:=Allwinner F1C100/200s | ||
CPU_TYPE:=arm926ej-s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# Copyright (C) 2013-2024 OpenWrt.org | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
KERNEL_LOADADDR=0x81000000 | ||
|
||
define Device/licheepi-nano | ||
DEVICE_VENDOR := LicheePi | ||
DEVICE_MODEL := Nano | ||
DEVICE_PACKAGES := kmod-rtc-sunxi | ||
SOC := suniv-f1c100s | ||
endef | ||
TARGET_DEVICES += licheepi-nano | ||
|
||
define Device/popstick-v1.1 | ||
DEVICE_VENDOR := PopStick | ||
DEVICE_MODEL := v1.1 | ||
DEVICE_PACKAGES := kmod-rtc-sunxi | ||
SOC := suniv-f1c200s | ||
endef | ||
TARGET_DEVICES += popstick-v1.1 |
37 changes: 37 additions & 0 deletions
37
target/linux/sunxi/patches-6.1/460-ARM-dts-suniv-add-USB-related-device-nodes.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/arch/arm/boot/dts/suniv-f1c100s.dtsi b/arch/arm/boot/dts/suniv-f1c100s.dtsi | ||
index 9455d27e516ee..111f8bbc2a805 100644 | ||
--- a/arch/arm/boot/dts/suniv-f1c100s.dtsi | ||
+++ b/arch/arm/boot/dts/suniv-f1c100s.dtsi | ||
@@ -133,6 +133,32 @@ mmc1: mmc@1c10000 { | ||
#size-cells = <0>; | ||
}; | ||
|
||
+ usb_otg: usb@1c13000 { | ||
+ compatible = "allwinner,suniv-f1c100s-musb"; | ||
+ reg = <0x01c13000 0x0400>; | ||
+ clocks = <&ccu CLK_BUS_OTG>; | ||
+ resets = <&ccu RST_BUS_OTG>; | ||
+ interrupts = <26>; | ||
+ interrupt-names = "mc"; | ||
+ phys = <&usbphy 0>; | ||
+ phy-names = "usb"; | ||
+ extcon = <&usbphy 0>; | ||
+ allwinner,sram = <&otg_sram 1>; | ||
+ status = "disabled"; | ||
+ }; | ||
+ | ||
+ usbphy: phy@1c13400 { | ||
+ compatible = "allwinner,suniv-f1c100s-usb-phy"; | ||
+ reg = <0x01c13400 0x10>; | ||
+ reg-names = "phy_ctrl"; | ||
+ clocks = <&ccu CLK_USB_PHY0>; | ||
+ clock-names = "usb0_phy"; | ||
+ resets = <&ccu RST_USB_PHY0>; | ||
+ reset-names = "usb0_reset"; | ||
+ #phy-cells = <1>; | ||
+ status = "disabled"; | ||
+ }; | ||
+ | ||
ccu: clock@1c20000 { | ||
compatible = "allwinner,suniv-f1c100s-ccu"; | ||
reg = <0x01c20000 0x400>; |
Oops, something went wrong.