forked from mirror/openwrt
uboot-airoha: Add support for Nokia Valyrian
Add support for Nokia Valyrian device that implement similar spec of an Airoha AN7581 RFB board. Link: https://github.com/openwrt/openwrt/pull/21761 Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
74d120c22d
commit
103e9aec15
2 changed files with 254 additions and 1 deletions
|
|
@ -54,11 +54,22 @@ define U-Boot/an7581_gemtek_w1700k
|
|||
UBOOT_IMAGE:=u-boot.bin
|
||||
endef
|
||||
|
||||
define U-Boot/an7581_nokia_valyrian
|
||||
NAME:=Nokia Valyrian
|
||||
UBOOT_CONFIG:=an7581_nokia_valyrian
|
||||
BUILD_DEVICES:=nokia_valyrian
|
||||
BUILD_SUBTARGET:=an7581
|
||||
UBOOT_IMAGE:=u-boot.fip
|
||||
BL2_IMAGE:=an7581-bl2.bin
|
||||
BL31_IMAGE:=an7581-bl31.bin
|
||||
endef
|
||||
|
||||
UBOOT_TARGETS := \
|
||||
en7523_rfb \
|
||||
an7581_rfb \
|
||||
an7583_rfb \
|
||||
an7581_gemtek_w1700k
|
||||
an7581_gemtek_w1700k \
|
||||
an7581_nokia_valyrian
|
||||
|
||||
UBOOT_CUSTOMIZE_CONFIG := \
|
||||
--disable TOOLS_KWBIMAGE \
|
||||
|
|
|
|||
242
package/boot/uboot-airoha/patches/400-add-nokia-valyrian.patch
Normal file
242
package/boot/uboot-airoha/patches/400-add-nokia-valyrian.patch
Normal file
|
|
@ -0,0 +1,242 @@
|
|||
--- /dev/null
|
||||
+++ b/arch/arm/dts/an7581-nokia-valyrian-u-boot.dtsi
|
||||
@@ -0,0 +1,104 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+
|
||||
+/ {
|
||||
+ /* When running as a first-stage bootloader this isn't filled in automatically */
|
||||
+ memory@80000000 {
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x0 0x80000000 0x0 0x40000000>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+#include "an7581-u-boot.dtsi"
|
||||
+
|
||||
+&mmc0 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+
|
||||
+ card@0 {
|
||||
+ compatible = "mmc-card";
|
||||
+ reg = <0>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ bl@800 {
|
||||
+ label = "bl2";
|
||||
+ reg = <0x00000800 0x0001f800>;
|
||||
+ };
|
||||
+
|
||||
+ bootloader@20000 {
|
||||
+ label = "bootloader";
|
||||
+ reg = <0x00020000 0x000e0000>;
|
||||
+ };
|
||||
+
|
||||
+ bootloader-inactive@100000 {
|
||||
+ label = "bootloader-inactive";
|
||||
+ reg = <0x00100000 0x000e0000>;
|
||||
+ };
|
||||
+
|
||||
+ u-boot-env@1e0000 {
|
||||
+ label = "u-boot-env";
|
||||
+ reg = <0x001e0000 0x00020000>;
|
||||
+
|
||||
+ u-boot,mmc-env-partition;
|
||||
+ };
|
||||
+
|
||||
+ factory@200000 {
|
||||
+ label = "factory";
|
||||
+ reg = <0x00200000 0x00800000>;
|
||||
+ };
|
||||
+
|
||||
+ mfgdata@a00000 {
|
||||
+ label = "mfgdata";
|
||||
+ reg = <0x00a00000 0x00100000>;
|
||||
+ };
|
||||
+
|
||||
+ kernel-active@b00000 {
|
||||
+ label = "kernel-active";
|
||||
+ reg = <0x00b00000 0x00800000>;
|
||||
+ };
|
||||
+
|
||||
+ kernel-inactive@1300000 {
|
||||
+ label = "kernel-inactive";
|
||||
+ reg = <0x01300000 0x00800000>;
|
||||
+ };
|
||||
+
|
||||
+ rootfs-active@1b00000 {
|
||||
+ label = "rootfs-active";
|
||||
+ reg = <0x01b00000 0x06400000>;
|
||||
+ };
|
||||
+
|
||||
+ rootfs-inactive@7f00000 {
|
||||
+ label = "rootfs-inactive";
|
||||
+ reg = <0x07f00000 0x06400000>;
|
||||
+ };
|
||||
+
|
||||
+ rootfs-data@e300000 {
|
||||
+ label = "rootfs_data";
|
||||
+ reg = <0x0e300000 0x02000000>;
|
||||
+ };
|
||||
+
|
||||
+ securestore@10300000 {
|
||||
+ label = "securestore";
|
||||
+ reg = <0x10300000 0x1000000>;
|
||||
+ };
|
||||
+
|
||||
+ lcm-data@11300000 {
|
||||
+ label = "lcm_data";
|
||||
+ reg = <0x11300000 0x40000000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&gdm1 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/configs/an7581_nokia_valyrian_defconfig
|
||||
@@ -0,0 +1,85 @@
|
||||
+CONFIG_ARM=y
|
||||
+CONFIG_ARCH_AIROHA=y
|
||||
+CONFIG_AUTOBOOT_USE_MENUKEY=y
|
||||
+CONFIG_AUTOBOOT_MENU_SHOW=y
|
||||
+CONFIG_TARGET_AN7581=y
|
||||
+CONFIG_TEXT_BASE=0x81e00000
|
||||
+CONFIG_SYS_MALLOC_F_LEN=0x4000
|
||||
+CONFIG_NR_DRAM_BANKS=1
|
||||
+CONFIG_ENV_SIZE=0x20000
|
||||
+CONFIG_ENV_OFFSET=0x1e0000
|
||||
+CONFIG_DM_GPIO=y
|
||||
+CONFIG_DEFAULT_DEVICE_TREE="airoha/an7581-nokia-valyrian"
|
||||
+CONFIG_SYS_LOAD_ADDR=0x81800000
|
||||
+CONFIG_BUILD_TARGET="u-boot.bin"
|
||||
+# CONFIG_EFI_LOADER is not set
|
||||
+CONFIG_FIT=y
|
||||
+CONFIG_FIT_VERBOSE=y
|
||||
+CONFIG_BOOTDELAY=3
|
||||
+CONFIG_DEFAULT_FDT_FILE="airoha/an7581-nokia-valyrian.dtb"
|
||||
+CONFIG_SYS_PBSIZE=1049
|
||||
+CONFIG_SYS_CONSOLE_IS_IN_ENV=y
|
||||
+# CONFIG_DISPLAY_BOARDINFO is not set
|
||||
+CONFIG_HUSH_PARSER=y
|
||||
+CONFIG_SYS_PROMPT="AN7581> "
|
||||
+CONFIG_SYS_MAXARGS=8
|
||||
+CONFIG_CMD_ASKENV=y
|
||||
+CONFIG_CMD_BOOTZ=y
|
||||
+CONFIG_CMD_BOOTMENU=y
|
||||
+# CONFIG_CMD_ELF is not set
|
||||
+# CONFIG_CMD_XIMG is not set
|
||||
+CONFIG_CMD_BIND=y
|
||||
+CONFIG_CMD_ERASEENV=y
|
||||
+CONFIG_CMD_GPIO=y
|
||||
+CONFIG_CMD_MMC=y
|
||||
+CONFIG_CMD_MTD=y
|
||||
+CONFIG_CMD_SF_TEST=y
|
||||
+CONFIG_CMD_SPI=y
|
||||
+# CONFIG_CMD_SETEXPR is not set
|
||||
+CONFIG_CMD_PING=y
|
||||
+CONFIG_CMD_EXT4=y
|
||||
+CONFIG_CMD_FAT=y
|
||||
+CONFIG_CMD_FS_GENERIC=y
|
||||
+CONFIG_CMD_MTDPARTS=y
|
||||
+CONFIG_CMD_LOG=y
|
||||
+CONFIG_OF_UPSTREAM=y
|
||||
+CONFIG_ENV_OVERWRITE=y
|
||||
+CONFIG_ENV_IS_IN_MMC=y
|
||||
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
|
||||
+CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
|
||||
+CONFIG_NET_RANDOM_ETHADDR=y
|
||||
+CONFIG_SYS_RX_ETH_BUFFER=8
|
||||
+CONFIG_REGMAP=y
|
||||
+CONFIG_SYSCON=y
|
||||
+CONFIG_CLK=y
|
||||
+CONFIG_DMA=y
|
||||
+CONFIG_LED=y
|
||||
+CONFIG_LED_GPIO=y
|
||||
+CONFIG_MMC_HS200_SUPPORT=y
|
||||
+CONFIG_MMC_MTK=y
|
||||
+CONFIG_AIROHA_ETH=y
|
||||
+CONFIG_DM_MDIO=y
|
||||
+CONFIG_CMD_MII=y
|
||||
+CONFIG_CMD_MDIO=y
|
||||
+CONFIG_PCS_AIROHA_AN7581=y
|
||||
+CONFIG_PHY=y
|
||||
+CONFIG_PINCTRL=y
|
||||
+CONFIG_PINCONF=y
|
||||
+CONFIG_POWER_DOMAIN=y
|
||||
+CONFIG_DM_REGULATOR=y
|
||||
+CONFIG_DM_REGULATOR_FIXED=y
|
||||
+CONFIG_RAM=y
|
||||
+CONFIG_DM_SERIAL=y
|
||||
+CONFIG_SYS_NS16550=y
|
||||
+CONFIG_SPI=y
|
||||
+CONFIG_DM_SPI=y
|
||||
+CONFIG_AIROHA_SNFI_SPI=y
|
||||
+CONFIG_SHA512=y
|
||||
+CONFIG_USE_DEFAULT_ENV_FILE=y
|
||||
+CONFIG_DEFAULT_ENV_FILE="defenvs/an7581_nokia_valyrian_env"
|
||||
+CONFIG_FIP_LOADER=y
|
||||
+CONFIG_PCS_AIROHA_AN7581=y
|
||||
+CONFIG_PHY_AIROHA_EN8811=y
|
||||
+CONFIG_PHY_ANEG_TIMEOUT=10000
|
||||
+CONFIG_PHY_ETHERNET_ID=y
|
||||
+CONFIG_PHY_AS21XXX=y
|
||||
--- /dev/null
|
||||
+++ b/defenvs/an7581_nokia_valyrian_env
|
||||
@@ -0,0 +1,25 @@
|
||||
+loadaddr=0x90000000
|
||||
+ipaddr=192.168.1.1
|
||||
+serverip=192.168.1.10
|
||||
+emmc_bootfile_bl2=openwrt-airoha-an7581-nokia_valyrian-preloader.bin
|
||||
+emmc_bootfile_fip=openwrt-airoha-an7581-nokia_valyrian-bl31-uboot.fip
|
||||
+bootmenu_confirm_return=askenv - Press ENTER to return to menu ; bootmenu 60
|
||||
+bootmenu_default=0
|
||||
+bootmenu_delay=0
|
||||
+bootmenu_title= [0;34m( ( ( [1;39mOpenWrt[0;34m ) ) ) [0;36m[EMMC][0m
|
||||
+bootmenu_0=Initialize environment.=run _firstboot
|
||||
+bootmenu_0d=Run default boot command.=run boot_default
|
||||
+bootmenu_1=[31mLoad BL31+U-Boot FIP via TFTP then write to eMMC.[0m=run emmc_boot_tftp_write_fip ; run bootmenu_confirm_return
|
||||
+bootmenu_2=[31mLoad BL2 preloader via TFTP then write to eMMC.[0m=run emmc_boot_tftp_write_bl2 ; run bootmenu_confirm_return
|
||||
+bootmenu_3=Reboot.=reset
|
||||
+bootmenu_4=Reset all settings to factory defaults.=run reset_factory ; reset
|
||||
+boot_default=bootm
|
||||
+reset_factory=eraseenv && reset
|
||||
+emmc_boot_tftp_write_fip=tftpboot $loadaddr $emmc_bootfile_fip && run emmc_write_fip
|
||||
+emmc_boot_tftp_write_bl2=tftpboot $loadaddr $emmc_bootfile_bl2 && run emmc_write_bl2
|
||||
+emmc_write_bl2=mmc erase 0x4 0xfc && mmc write $fileaddr 0x4 0xfc
|
||||
+emmc_write_fip=mmc erase 0x100 0x700 && mmc write $fileaddr 0x100 0x700
|
||||
+_init_env=setenv _init_env ; saveenv
|
||||
+_firstboot=setenv _firstboot ; run _switch_to_menu ; run _init_env ; bootmenu
|
||||
+_switch_to_menu=setenv _switch_to_menu ; setenv bootdelay 3 ; setenv bootmenu_delay 3 ; setenv bootmenu_0 $bootmenu_0d ; setenv bootmenu_0d ; run _bootmenu_update_title
|
||||
+_bootmenu_update_title=setenv _bootmenu_update_title ; setenv bootmenu_title "$bootmenu_title [33m$ver[0m"
|
||||
--- /dev/null
|
||||
+++ b/dts/upstream/src/arm64/airoha/an7581-nokia-valyrian.dts
|
||||
@@ -0,0 +1,16 @@
|
||||
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include <dt-bindings/leds/common.h>
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+#include "en7581.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Nokia Valyrian";
|
||||
+ compatible = "nokia,valyrian", "airoha,an7581", "airoha,en7581";
|
||||
+
|
||||
+ chosen {
|
||||
+ stdout-path = &uart1;
|
||||
+ };
|
||||
+};
|
||||
Loading…
Add table
Reference in a new issue