layerscape: resurrect support for FRDM-LS1012A
authorTomasz Maciej Nowak <tomek_n@o2.pl>
Tue, 25 Feb 2020 19:07:36 +0000 (20:07 +0100)
committerPetr Štetiar <ynezz@true.cz>
Thu, 12 Mar 2020 11:59:44 +0000 (12:59 +0100)
Re-add support for NXP FRDM-LS1012A, which mimics the flash layout of the
rest boards supported by LSDK.

0x000000000000-0x000000100000 : "bl2"
0x000000100000-0x000000500000 : "fip"
0x000000500000-0x000000600000 : "u-boot-env"
0x000000600000-0x000000a00000 : "reserved-1"
0x000000a00000-0x000000d00000 : "pfe"
0x000000d00000-0x000000f00000 : "reserved-2"
0x000000f00000-0x000001000000 : "dtb"
0x000001000000-0x000002000000 : "kernel"
0x000002000000-0x000004000000 : "ubifs"

Specification
SoC: LS1012A single core 800MHz
RAM: 512 MB DDR3
Flash: 64 MB QSPI NOR
Ethernet: 2x 10/100/1000 Mbps
Connectors: µUSB 3.0 OTG
            µUSB 2.0 (debugging & power input)
            2x 3.5mm jack for microphone & headphone (SGTL5000)
            Arduino Shield expansion with I2C, SPI, UART, and GPIO
            JTAG
LEDS: 3x (non-configurable)
Buttons: 1x (reset, non-configurable)

Be advised that erasing or writing 64MB flash takes some time to finish.
Do not reset the board until all operations end with success, otherwise
You'll need external tools to re-program the flash chip.

Installation
Follow the QSPI programing procedure for LS1012AFRWY board in
target/linux/layerscape/README, point 3.3.
Don't forget about updating U-Boot environment with MAC addresses of
ethernet interfaces, variable 'ethaddr' for eth0 and 'eth1addr' for eth1.

As the LSDK images do not support sysupgrade, nor do changes in this
commit, it's planed in upcoming submissions.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
package/boot/tfa-layerscape/Makefile
package/boot/uboot-layerscape/Makefile
package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt [new file with mode: 0644]
package/firmware/layerscape/ls-rcw/Makefile
target/linux/layerscape/image/armv8_64b.mk

index a34c52bc3b5acec33bc956698da10f801b38a2bb..d2da84ec159a4e80bbe0c91ab1c3aea778313065 100644 (file)
@@ -69,6 +69,14 @@ define Host/Install
        $(INSTALL_BIN) $(HOST_BUILD_DIR)/plat/nxp/tools/byte_swap $(STAGING_DIR_HOST)/bin/tfa-byte-swap
 endef
 
+define Package/tfa-layerscape/ls1012afrdm
+  TITLE:=NXP LS1012AFRDM Trusted Firmware
+  PLAT:=ls1012afrdm
+  BOOT_MODE:=qspi
+  BIN_BL2:=build/ls1012afrdm/release/bl2_qspi.pbl
+  BIN_FIP:=build/ls1012afrdm/release/fip.bin
+endef
+
 define Package/tfa-layerscape/ls1012ardb
   TITLE:=NXP LS1012ARDB Trusted Firmware
   PLAT:=ls1012ardb
@@ -142,6 +150,7 @@ define Package/tfa-layerscape/ls2088ardb
 endef
 
 TFAS := \
+  ls1012afrdm \
   ls1012ardb \
   ls1012afrwy \
   ls1043ardb \
index ddf71bd986b948dc57d4596539e9480f9d3d3323..63c16a7db0afbc023901dbbd22a90e6c577fbdb4 100644 (file)
@@ -27,6 +27,12 @@ define U-Boot/Default
   ENV_SIZE:=0x2000
 endef
 
+define U-Boot/ls1012afrdm
+  NAME:=NXP LS1012AFRDM
+  UBOOT_CONFIG:=ls1012afrdm_tfa
+  ENV_SIZE:=0x40000
+endef
+
 define U-Boot/ls1012ardb
   NAME:=NXP LS1012ARDB
   UBOOT_CONFIG:=ls1012ardb_tfa
@@ -102,6 +108,7 @@ endef
 
 
 UBOOT_TARGETS := \
+  ls1012afrdm \
   ls1012ardb \
   ls1012afrwy \
   ls1043ardb \
diff --git a/package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt b/package/boot/uboot-layerscape/files/ls1012afrdm-uEnv.txt
new file mode 100644 (file)
index 0000000..ccc98dd
--- /dev/null
@@ -0,0 +1,8 @@
+fdtaddr=0x8f000000
+loadaddr=0x81000000
+fdt_high=0xffffffffffffffff
+initrd_high=0xffffffffffffffff
+qspi_boot=sf probe 0:0;sf read $fdtaddr f00000 100000;sf read $loadaddr 1000000 1000000;bootm $loadaddr - $fdtaddr
+bootargs=ubi.mtd=8 root=ubi0:rootfs rw rootfstype=ubifs noinitrd earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 mtdparts=1550000.quadspi:1m(bl2),4m(fip),1m(u-boot-env),4m(reserved-1),3m(pfe),2m(reserved-2),1m(dtb),16m(kernel),32m(ubifs)
+bootcmd=echo starting OpenWrt ...;pfe stop;run qspi_boot
+bootdelay=3
index 5bcbff5bc46e3d76a9efbf91b2f85f91ccc95f14..ddef58fa0be72001ecd75189bceb325d83ca705a 100644 (file)
@@ -28,6 +28,11 @@ define Package/layerscape-rcw/Config
   endef
 endef
 
+define Package/layerscape-rcw/ls1012afrdm
+  TITLE:=NXP LS1012AFRDM RCW binary
+  CONFIG:=ls1012afrdm/N_SSNP_3305/rcw_800.bin
+endef
+
 define Package/layerscape-rcw/ls1012ardb
   TITLE:=NXP LS1012ARDB RCW binary
   CONFIG:=ls1012ardb/R_SPNH_3508/rcw_1000_default.bin
@@ -86,6 +91,7 @@ define Package/layerscape-rcw/Install
 endef
 
 RCWS := \
+  ls1012afrdm \
   ls1012ardb \
   ls1012afrwy \
   ls1043ardb \
index 61ea849119a864f1b09964d3fd32447ec87c606d..0322183b9647e52cd9cd07fce3a22d2a0220d41f 100644 (file)
@@ -15,6 +15,29 @@ define Device/Default
   KERNEL_ENTRY_POINT := 0x80080000
 endef
 
+define Device/ls1012afrdm
+  DEVICE_VENDOR := NXP
+  DEVICE_MODEL := FRDM-LS1012A
+  DEVICE_PACKAGES += \
+    layerscape-ppfe \
+    tfa-ls1012afrdm \
+    kmod-ppfe
+  DEVICE_DTS := freescale/fsl-ls1012a-frdm
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 256KiB
+  PAGESIZE := 1
+  IMAGE/firmware.bin := \
+    ls-clean | \
+    ls-append $(1)-bl2.pbl | pad-to 1M | \
+    ls-append $(1)-fip.bin | pad-to 5M | \
+    ls-append $(1)-uboot-env.bin | pad-to 10M | \
+    ls-append pfe.itb | pad-to 15M | \
+    ls-append-dtb $$(DEVICE_DTS) | pad-to 16M | \
+    append-kernel | pad-to 32M | \
+    append-ubi | check-size 67108865
+endef
+TARGET_DEVICES += ls1012afrdm
+
 define Device/ls1012ardb
   DEVICE_VENDOR := NXP
   DEVICE_MODEL := LS1012A-RDB