openwrt/target/linux/layerscape
John Audia 5158e28769 kernel: bump 6.6 to 6.6.64
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.64

Manually rebased:
	generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch
	bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch
	bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch
	bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch

Removed upstreamed:
	bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch[1]
	bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch[2]
	bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch[3]
	bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch[4]
	ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch[5]
	ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch[6]

All other patches automatically rebased.

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=223ee2567a55e4f80315c768d2969e6a3b9fb23d
2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=8182b5ca19c6f173b6498d1c6d3e4b034b76bbde
3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=52c1716f65a558174e381360bd88f18dae4be85c
4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=9728b508b01a5eeeac79ceb676364c674dd951ac
5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=f85a1d06afbcc57ac44176db8f9d7a934979952c
6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=fbb13732c6ffa9d58cedafabcd5ce8fd7ef8ae5a

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

Co-authored-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Signed-off-by: John Audia <therealgraysky@proton.me>
Link: https://github.com/openwrt/openwrt/pull/17217
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-12-13 21:40:02 +01:00
..
armv7 kernel: filter out compiler opts from config 2024-11-17 14:55:16 +01:00
armv8_64b kernel: filter out compiler opts from config 2024-11-17 14:55:16 +01:00
base-files layerscape: base-files: remove redundant RAMFS_COPY_* additions 2023-07-08 18:33:18 +02:00
image layerscape: drop fmc and fmc-eth-config package 2024-10-29 00:07:55 +01:00
patches-6.6 kernel: bump 6.6 to 6.6.64 2024-12-13 21:40:02 +01:00
Makefile layerscape: switch to 6.6 kernel 2024-08-02 12:15:44 +02:00
modules.mk layerscape: kmod-ppfe: Use ppfe driver as module 2022-11-27 13:18:29 +01:00
README layerscape: Add ls1028ardb support 2023-05-07 14:50:50 +02:00

Layerscape Quick Start

This is a quick start guide for Layerscape specific usage, like introducing
how to configure, build, and deploy OpenWrt to Layerscape boards, so that
users can bring up the board without difficulty.


1. Target support
----------------------------
* ARMv8 64-bit
  LS1012ARDB        (QSPI NOR boot)
  LS1012AFRDM       (QSPI NOR boot)
  LS1012AFRWY       (QSPI NOR boot)
  LS1028ARDB        (QSPI NOR boot    | SD card boot)
  LS1043ARDB        (NOR boot         | SD card boot)
  LS1046ARDB        (QSPI NOR boot    | SD card boot)
  LS1046AFRWY       (QSPI NOR boot    | SD card boot)
  LS1088ARDB        (QSPI NOR boot    | SD card boot)
  LS2088ARDB        (NOR boot)
  LX2160ARDB Rev2.0 (FlexSPI NOR boot | SD card boot)

* ARMv7
  LS1021ATWR        (NOR boot | SD card boot)
  LS1021AIOT        (SD card boot)


2. Build
--------
Before configuration and build, update and install package feeds.

$ ./scripts/feeds update -a
$ ./scripts/feeds install -a

* make menuconfig
  Target System:   "NXP Layerscape"
  Subtarget:       (Select subtarget)
  Target Profile:  (Select device, or "Multiple devices")
  Target Devices:  (Select devices. Available when Target Profile is "Multiple devices")
  Target Images:   (Disable "GZip images" if you don't want to unzip manually to use the images.)

  Note: The first time make menuconfig would create a .config file which
  would include all dependencies for selected target. After that, make
  menuconfig still could be used to modify packages. If want to change
  other target, please remove .config and make menuconfig to select again.
  Otherwise the packages selected in .config would be a mess.

* make download (or make download -j<n>)

* make (or make -j<n>)

* Final firmware/image
  Path:               bin/targets/layerscape/<subtarget>/
  Firmware for flash: openwrt-layerscape-<subtarget>-<device>-<rootfs>-firmware.bin
  Image for SD card:  openwrt-layerscape-<subtarget>-<device>-<rootfs>-sdcard.img.gz
  Sysupgrade images:  openwrt-layerscape-<subtarget>-<device>-<rootfs>-sysupgrade.bin


3. Deploy
---------
The firmware.bin or sdcard.img is an all-in-one image including all things
for OpenWrt staring up except LS1012AFRWY (Refer to 3.3).
If you want to install all things into flash, please use firmware.bin.
If you want to install all things into SD card, please use sdcard.img.

3.1 Program sdcard.img to SD card
---------------------------------
sdcard.img could be programmed to SD card in either u-boot environment
or linux environment. After programming, configure the board to boot
from SD card. (sdcard.img images are gz-iped to save space. Please extract them first.)

* u-boot environment

  => tftp a0000000 <image_name>-sdcard.img
  => mmc write a0000000 0 a0000

  Note: The default sdcard.img size is 320MB. a0000 is the block number for 320MB.
  blk_num = filesize / 512.

* linux environment

  $ dd if=./<image_name>-sdcard.img of=/dev/mmcblkx

  Note: Need to check the SD card device name to replace "mmcblkx".

3.2 Program firmware.bin to flash
---------------------------------
* LS1012ARDB
  Start up from bank1, and program firmware to bank2 with below commands.
  Switch to bank2 to start up OpenWrt.

  => tftp a0000000 <firmware_name>-firmware.bin
  => i2c mw 0x24 0x7 0xfc;i2c mw 0x24 0x3 0xf5
  => sf probe 0:0
  => sf erase 0 +$filesize
  => sf write a0000000 0 $filesize
  => reset

* LS1028ARDB
  Board has only one bank. Those commands will replace stock bootloader
  and firmware.
  => tftp a0000000 <firmware_name>-firmware.bin
  => sf probe 0:0
  => sf erase 0 +$filesize
  => sf write a0000000 0 $filesize
  => reset

* LS1043ARDB
  Start up from bank0, and program firmware to bank4 with below commands.
  Switch to bank4 to start up OpenWrt.

  => tftp a0000000 <firmware_name>-firmware.bin
  => protect off all
  => erase 64000000 +$filesize
  => cp.b a0000000 64000000 $filesize
  => cpld reset altbank

* LS1046ARDB
  Start up from bank1, and program firmware to bank2 with below commands.
  Switch to bank2 to start up OpenWrt.

  => tftp a0000000 <firmware_name>-firmware.bin
  => sf probe 0:1
  => sf erase 0 +$filesize
  => sf write a0000000 0 $filesize
  => cpld reset altbank

* LS2088ARDB
  Start up from bank0, and program firmware to bank4 with below commands.
  Switch to bank4 to start up OpenWrt.

  => tftp a0000000 <firmware_name>-firmware.bin
  => protect off all
  => erase 584000000 +$filesize
  => cp.b a0000000 584000000 $filesize
  => qix altbank

* LS1012FRDM/LS1046AFRWY
  Board has only one bank. Those commands will replace stock bootloader
  and firmware.

  => tftp a0000000 <firmware_name>-firmware.bin
  => sf probe 0:0
  => sf erase 0 +$filesize
  => sf write a0000000 0 $filesize
  => reset

* LS1088ARDB/LX2160ARDB Rev2.0
  Start up from bank0, and program firmware to bank1 with below commands.
  Switch to bank1 to start up OpenWrt.

  => tftp a0000000 <firmware_name>-firmware.bin
  => sf probe 0:1
  => sf erase 0 +$filesize
  => sf write a0000000 0 $filesize
  => qix altbank

  Note: old version u-boot of ls1088ardb may use below commands to switch to
  bank1 instead of 'qix altbank'.
  => i2c mw 66 50 20;i2c mw 66 10 20;i2c mw 66 10 21

* LS1021ATWR
  Start up from bank0, and program firmware to bank4 with below commands.
  Switch to bank4 to start up OpenWrt.

  => tftp a0000000 <firmware_name>-firmware.bin
  => protect off all
  => erase 64000000 +$filesize
  => cp.b a0000000 64000000 $filesize
  => boot_bank 1

3.3 Program LS1012AFRWY
-----------------------
* LS1012AFRWY (QSPI flash + SD card)
  LS1012AFRWY only supports 2MB QSPI flash. We have to put u-boot, and
  some firmwares on QSPI flash, and kernel/dtb/rootfs on SD card.
  So both firmware.bin and sdcard.img are needed for OpenWrt starting up.

  To program sdcard.img, please use linux command described in 3.1 on a
  linux machine.
  To program firmware.bin, start up board from QSPI flash, and program
  firmware with below commands. Reset to start up OpenWrt. (LS1012AFRWY
  supports only one bank.)

  => tftp 96000000 <firmware_name>-firmware.bin
  => sf probe 0:0
  => sf erase 0 +$filesize
  => sf write 96000000 0 $filesize
  => reset


4. Known issues and limitation
------------------------------
* U-boot may fail to read MAC addresses from EEPROM on some boards and there
  won't be MAC addresses set in environment. This may cause kernel fails to
  probe these network interfaces. The workaround is to set MAC addresses
  manually, for example,

  => setenv ethaddr 00:04:9F:04:65:4b
  => setenv eth1addr 00:04:9F:04:65:4c
  => saveenv

* In case users want to refer Layerscape SDK doc for network configuration,
  like TSN (Time-Sensitive Networking) on LS1028A, the OpenWrt LAN/WAN router
  setting should be removed before that.

  # ubus call network.interface.lan remove
  # ubus call network.interface.wan remove
  # ubus call network.interface.wan6 remove

  And firewall may be needed to stop.

  # /etc/init.d/firewall stop


5. Other references
-------------------
- NXP LSDK source: https://lsdk.github.io/

- NXP LSDK site: https://www.nxp.com/design/software/embedded-software/linux-software-and-development-tools/layerscape-software-development-kit:LAYERSCAPE-SDK

- OpenWrt documentation: https://openwrt.org/docs/start