Basic Kontron SMARC-sAL28 board support
v7 cover Basic Kontron SMARC-sAL28 board support
Add basic board support for the Kontron SMARC-sAL28 board. Please note, that this board doesn't support TF-a (yet). Therefore, the u-boot SPL is the first code which is run and it has to set up the RAM.
changes since v6:
- moved README to doc/board/kontron/sl28.rst
- added device tree files to MAINTAINERS
- converted preprocessor macros to actual code using IS_ENABLED()
- fixed sec_init(), use CONFIG_IS_ENABLED() instead of IS_ENABLED()
- removed unnecessary #ifdef CONFIG_OF_BOARD_SETUP
- removed CONFIG_SPL_TARGET, because we use binman, this is not needed anymore
- removed unnecessary CONFIG_SYS_MONITOR_BASE macro
- redefinded memory addresses according to the comment in ti_armv7_common.h
- removed empty BOOTENV for SPL build
- removed fdt_high and initrd_high
Thanks Tom!
changes since v5:
- moved CONFIG_ENV_OVERWRITE to defconfig. Thanks Kuldeep!
changes since v4:
- dropped "armv8: ls1028a: move FSL_LAYERSCAPE to kconfig" as it is already upstream
- new patch "board: sl28: add board specific nvm command"
- use binman
- sync device trees with linux
- use "<devicetree>-u-boot.dtsi" style
- rebase to lastest master
changes since v3:
- rebase to latest master
- use CONFIG_PCI_INIT_R
- set fdtfile in default environment
changes since v2:
- add variant 4 support. Since the atheros PHY dt bindings were merged into master, we can now use them
- add environment section in include/configs/kontron_sl28.h
- add cover letter
changes since v1:
- fix watchdog device tree reference
Michael Walle (2):
board: kontron: add sl28 support
board: sl28: add board specific nvm command
arch/arm/Kconfig | 11 + arch/arm/dts/Makefile | 3 + .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 135 +++++++++++++ .../fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var3.dts | 15 ++ .../fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var4.dts | 48 +++++ arch/arm/dts/fsl-ls1028a-kontron-sl28.dts | 189 ++++++++++++++++++ board/kontron/sl28/Kconfig | 18 ++ board/kontron/sl28/MAINTAINERS | 7 + board/kontron/sl28/Makefile | 8 + board/kontron/sl28/cmds.c | 178 +++++++++++++++++ board/kontron/sl28/common.c | 10 + board/kontron/sl28/ddr.c | 98 +++++++++ board/kontron/sl28/sl28.c | 68 +++++++ board/kontron/sl28/spl.c | 32 +++ configs/kontron_sl28_defconfig | 107 ++++++++++ doc/board/index.rst | 1 + doc/board/kontron/index.rst | 9 + doc/board/kontron/sl28.rst | 160 +++++++++++++++ include/configs/kontron_sl28.h | 109 ++++++++++ 21 files changed, 1210 insertions(+) create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts create mode 100644 board/kontron/sl28/Kconfig create mode 100644 board/kontron/sl28/MAINTAINERS create mode 100644 board/kontron/sl28/Makefile create mode 100644 board/kontron/sl28/cmds.c create mode 100644 board/kontron/sl28/common.c create mode 100644 board/kontron/sl28/ddr.c create mode 100644 board/kontron/sl28/sl28.c create mode 100644 board/kontron/sl28/spl.c create mode 100644 configs/kontron_sl28_defconfig create mode 100644 doc/board/kontron/index.rst create mode 100644 doc/board/kontron/sl28.rst create mode 100644 include/configs/kontron_sl28.h
Signature · 1 line
2.20.1
PATCH v7 1/2 board: kontron: add sl28 support
Add basic support for the Kontron SMARC-sAL28 board. This includes just the bare minimum to be able to bring up the board and boot linux.
For now, the Single and Dual PHY variant is supported. Other variants will fall back to the basic variant.
In particular, there is no watchdog support for now. This means that you have to disable the default watchdog, otherwise you'll end up in the recovery bootloader. See the board README for details.
--- arch/arm/Kconfig | 11 + arch/arm/dts/Makefile | 3 + .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 135 +++++++++++++ .../fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var3.dts | 15 ++ .../fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var4.dts | 48 +++++ arch/arm/dts/fsl-ls1028a-kontron-sl28.dts | 189 ++++++++++++++++++ board/kontron/sl28/Kconfig | 18 ++ board/kontron/sl28/MAINTAINERS | 7 + board/kontron/sl28/Makefile | 8 + board/kontron/sl28/common.c | 10 + board/kontron/sl28/ddr.c | 98 +++++++++ board/kontron/sl28/sl28.c | 68 +++++++ board/kontron/sl28/spl.c | 32 +++ configs/kontron_sl28_defconfig | 107 ++++++++++ doc/board/index.rst | 1 + doc/board/kontron/index.rst | 9 + doc/board/kontron/sl28.rst | 160 +++++++++++++++ include/configs/kontron_sl28.h | 108 ++++++++++ 20 files changed, 1031 insertions(+) create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts create mode 100644 board/kontron/sl28/Kconfig create mode 100644 board/kontron/sl28/MAINTAINERS create mode 100644 board/kontron/sl28/Makefile create mode 100644 board/kontron/sl28/common.c create mode 100644 board/kontron/sl28/ddr.c create mode 100644 board/kontron/sl28/sl28.c create mode 100644 board/kontron/sl28/spl.c create mode 100644 configs/kontron_sl28_defconfig create mode 100644 doc/board/kontron/index.rst create mode 100644 doc/board/kontron/sl28.rst create mode 100644 include/configs/kontron_sl28.h
arch/arm/Kconfig +11 -0
@@ -1615,6 +1615,16 @@ config TARGET_LS1046AFRWY development platform that supports the QorIQ LS1046A Layerscape Architecture processor. +config TARGET_SL28 + bool "Support sl28" + select ARCH_LS1028A + select ARM64 + select ARMV8_MULTIENTRY + select SUPPORT_SPL + select BINMAN + help + Support for Kontron SMARC-sAL28 board. + config TARGET_COLIBRI_PXA270 bool "Support colibri_pxa270" select CPU_PXA
@@ -1986,6 +1996,7 @@ source "board/hisilicon/hikey/Kconfig" source "board/hisilicon/hikey960/Kconfig" source "board/hisilicon/poplar/Kconfig" source "board/isee/igep003x/Kconfig" +source "board/kontron/sl28/Kconfig" source "board/myir/mys_6ulx/Kconfig" source "board/spear/spear300/Kconfig" source "board/spear/spear310/Kconfig"
arch/arm/dts/Makefile +3 -0
@@ -422,6 +422,9 @@ dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds-duart.dtb \ fsl-ls1012a-2g5rdb.dtb \ fsl-ls1012a-frdm.dtb \ fsl-ls1012a-frwy.dtb +dtb-$(CONFIG_TARGET_SL28) += fsl-ls1028a-kontron-sl28.dtb \ + fsl-ls1028a-kontron-sl28-var3.dtb \ + fsl-ls1028a-kontron-sl28-var4.dtb \ dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb
arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi new file +135 -0
135 lines not on this page · raw message
arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi new file +2 -0
@@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include "fsl-ls1028a-kontron-sl28-u-boot.dtsi"
arch/arm/dts/fsl-ls1028a-kontron-sl28-var3.dts new file +15 -0
@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Device Tree file for the Kontron SMARC-sAL28 board. + * + * Copyright (C) 2019 Michael Walle <[email protected]> + * + */ + +/dts-v1/; +#include "fsl-ls1028a-kontron-sl28.dts" + +/ { + model = "Kontron SMARC-sAL28 (Single PHY)"; + compatible = "kontron,sl28-var3", "kontron,sl28", "fsl,ls1028a"; +};
arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi new file +2 -0
@@ -0,0 +1,2 @@ +// SPDX-License-Identifier: GPL-2.0+ +#include "fsl-ls1028a-kontron-sl28-u-boot.dtsi"
arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts new file +48 -0
48 lines not on this page · raw message
arch/arm/dts/fsl-ls1028a-kontron-sl28.dts new file +189 -0
189 lines not on this page · raw message
board/kontron/sl28/Kconfig new file +18 -0
@@ -0,0 +1,18 @@ +if TARGET_SL28 + +config SYS_BOARD + default "sl28" + +config SYS_VENDOR + default "kontron" + +config SYS_SOC + default "fsl-layerscape" + +config SYS_CONFIG_NAME + default "kontron_sl28" + +config SYS_TEXT_BASE + default 0x96000000 + +endif
board/kontron/sl28/MAINTAINERS new file +7 -0
@@ -0,0 +1,7 @@ +Kontron SMARC-sAL28 board +M: Michael Walle <[email protected]> +S: Maintained +F: arch/arm/dts/fsl-ls1028a-kontron-sl28-* +F: board/kontron/sl28/ +F: configs/kontron_sl28_defconfig +F: include/configs/kontron_sl28.h
board/kontron/sl28/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ + +ifndef CONFIG_SPL_BUILD +obj-y += sl28.o +endif + +obj-y += common.o ddr.o +obj-$(CONFIG_SPL_BUILD) += spl.o
board/kontron/sl28/common.c new file +10 -0
@@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <common.h> +#include <asm/arch-fsl-layerscape/soc.h> + +int board_early_init_f (void ) +{ +fsl_lsch3_early_init_f (); +return 0 ; +}
board/kontron/sl28/ddr.c new file +98 -0
98 lines not on this page · raw message
board/kontron/sl28/sl28.c new file +68 -0
68 lines not on this page · raw message
board/kontron/sl28/spl.c new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ + +#include <common.h> +#include <asm/io.h> +#include <asm/spl.h> + +#define DCFG_RCWSR25 0x160 +#define GPINFO_HW_VARIANT_MASK 0xff + +int sl28_variant (void ) +{ +return in_le32 (DCFG_BASE +DCFG_RCWSR25 ) &GPINFO_HW_VARIANT_MASK ; +} + +int board_fit_config_name_match (const char *name) +{ +int variant =sl28_variant (); + +switch (variant) { +case 3 : +return strcmp (name,"fsl-ls1028a-kontron-sl28-var3" ); +case 4 : +return strcmp (name,"fsl-ls1028a-kontron-sl28-var4" ); +default : +return strcmp (name,"fsl-ls1028a-kontron-sl28" ); + } +} + +void board_boot_order (u32 *spl_boot_list) +{ + spl_boot_list[0 ] =BOOT_DEVICE_SPI ; +}
configs/kontron_sl28_defconfig new file +107 -0
107 lines not on this page · raw message
doc/board/index.rst +1 -0
@@ -15,6 +15,7 @@ Board-specific doc freescale/index google/index intel/index + kontron/index renesas/index rockchip/index sifive/index
doc/board/kontron/index.rst new file +9 -0
@@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Kontron +======= + +.. toctree:: + :maxdepth: 2 + + sl28
doc/board/kontron/sl28.rst new file +160 -0
160 lines not on this page · raw message
include/configs/kontron_sl28.h new file +108 -0
108 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v7 1/2 board: kontron: add sl28 support
Quoted 11 lines · Michael Walle
Add basic support for the Kontron SMARC-sAL28 board. This includes just the bare minimum to be able to bring up the board and boot linux.
For now, the Single and Dual PHY variant is supported. Other variants will fall back to the basic variant.
In particular, there is no watchdog support for now. This means that you have to disable the default watchdog, otherwise you'll end up in the recovery bootloader. See the board README for details.
Signed-off-by Michael Walle <[email protected]>
Thanks for updating things.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200908/df714721/attachment.sig>
PATCH v7 1/2 board: kontron: add sl28 support
In reply to Michael WalleHi Michael,
Am Mo., 7. Sept. 2020 um 23:08 Uhr schrieb Michael Walle <[email protected]>:
Quoted 4 lines
Add basic support for the Kontron SMARC-sAL28 board. This includes just the bare minimum to be able to bring up the board and boot linux.
Quoted 8 lines
For now, the Single and Dual PHY variant is supported. Other variants will fall back to the basic variant.
In particular, there is no watchdog support for now. This means that you have to disable the default watchdog, otherwise you'll end up in the recovery bootloader. See the board README for details.
Signed-off-by Michael Walle <[email protected]>
After applying the patch
(https://patchwork.ozlabs.org/project/uboot/patch/20200803221633.24096-1-michael at walle.cc/)
I could boot the mainline kernel.
Quoted 40 lines
--- arch/arm/Kconfig | 11 + arch/arm/dts/Makefile | 3 + .../dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi | 135 +++++++++++++ .../fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var3.dts | 15 ++ .../fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi | 2 + .../arm/dts/fsl-ls1028a-kontron-sl28-var4.dts | 48 +++++ arch/arm/dts/fsl-ls1028a-kontron-sl28.dts | 189 ++++++++++++++++++ board/kontron/sl28/Kconfig | 18 ++ board/kontron/sl28/MAINTAINERS | 7 + board/kontron/sl28/Makefile | 8 + board/kontron/sl28/common.c | 10 + board/kontron/sl28/ddr.c | 98 +++++++++ board/kontron/sl28/sl28.c | 68 +++++++ board/kontron/sl28/spl.c | 32 +++ configs/kontron_sl28_defconfig | 107 ++++++++++ doc/board/index.rst | 1 + doc/board/kontron/index.rst | 9 + doc/board/kontron/sl28.rst | 160 +++++++++++++++ include/configs/kontron_sl28.h | 108 ++++++++++ 20 files changed, 1031 insertions(+) create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var3.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4-u-boot.dtsi create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28-var4.dts create mode 100644 arch/arm/dts/fsl-ls1028a-kontron-sl28.dts create mode 100644 board/kontron/sl28/Kconfig create mode 100644 board/kontron/sl28/MAINTAINERS create mode 100644 board/kontron/sl28/Makefile create mode 100644 board/kontron/sl28/common.c create mode 100644 board/kontron/sl28/ddr.c create mode 100644 board/kontron/sl28/sl28.c create mode 100644 board/kontron/sl28/spl.c create mode 100644 configs/kontron_sl28_defconfig create mode 100644 doc/board/kontron/index.rst create mode 100644 doc/board/kontron/sl28.rst create mode 100644 include/configs/kontron_sl28.h
[snip]
Quoted 40 lines
doc/board/index.rst +1
-0@@ -15,6 +15,7 @@ Board-specific doc freescale/index google/index intel/index + kontron/index renesas/index rockchip/index sifive/indexdoc/board/kontron/index.rst new file +9
-0@@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Kontron +======= + +.. toctree:: + :maxdepth: 2 + + sl28doc/board/kontron/sl28.rst new file +9
-0@@ -0,0 +1,160 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Summary +======= + +The Kontron SMARC-sAL28 board is a TSN-enabled dual-core ARM A72 +processor module with an on-chip 6-port TSN switch and a 3D GPU. + +
doc/board/kontron/sl28.rst line 19
Quoted 10 lines
doc/board/kontron/sl28.rst new file +10
-0+Quickstart +========== + +Compile U-Boot +-------------- + +Configure and compile the binary:: + + $ make kontron_sl28_defconfig + $ CROSS_COMPILE=aarch64-linux-gnu make
Small typo here. A missing '-'.
$ CROSS_COMPILE=aarch64-linux-gnu- make
Quoted 258 lines
doc/board/kontron/sl28.rst new file +141
-0+ +Copy u-boot.rom to a TFTP server. + +Install the bootloader on the board +----------------------------------- + +Please note, this bootloader doesn't support the builtin watchdog (yet), +therefore you have to disable it, see below. Otherwise you'll end up in +the failsafe bootloader on every reset:: + + > tftp path/to/u-boot.rom + > sf probe 0 + > sf update $fileaddr 0x210000 $filesize + +The board is fully failsafe, you can't break anything. But because you've +disabled the builtin watchdog you might have to manually enter failsafe +mode by asserting the ``FORCE_RECOV#`` line during board reset. + +Disable the builtin watchdog +---------------------------- + +- boot into the failsafe bootloader, either by asserting the + ``FORCE_RECOV#`` line or if you still have the original bootloader + installed you can use the command:: + + > wdt dev cpld_watchdog at 4a; wdt expire 1 + +- in the failsafe bootloader use the "sl28 nvm" command to disable + the automatic start of the builtin watchdog:: + + > sl28 nvm 0008 + +- power-cycle the board + + +Useful I2C tricks +================= + +The board has a board management controller which is not supported in +u-boot (yet). But you can use the i2c command to access it. + +- reset into failsafe bootloader:: + + > i2c mw 4a 5.1 0; i2c mw 4a 6.1 6b; i2c mw 4a 4.1 42 + +- read board management controller version:: + + > i2c md 4a 3.1 1 + + +Non-volatile Board Configuration Bits +===================================== + +The board has 16 configuration bits which are stored in the CPLD and are +non-volatile. These can be changed by the `sl28 nvm` command. + +=== =============================================================== +Bit Description +=== =============================================================== + 0 Power-on inhibit + 1 Enable eMMC boot + 2 Enable watchdog by default + 3 Disable failsafe watchdog by default + 4 Clock generator selection bit 0 + 5 Clock generator selection bit 1 + 6 Disable CPU SerDes clock #2 and PCIe-A clock output + 7 Disable PCIe-B and PCIe-C clock output + 8 Keep onboard PHYs in reset + 9 Keep USB hub in reset + 10 Keep eDP-to-LVDS converter in reset + 11 Enable I2C stuck recovery on I2C PM and I2C GP busses + 12 Enable automatic onboard PHY H/W reset + 13 reserved + 14 Used by the RCW to determine boot source + 15 Used by the RCW to determine boot source +=== =============================================================== + +Please note, that if the board is in failsafe mode, the bits will have the +factory defaults, ie. all bits are off. + +Power-On Inhibit +---------------- + +If this is set, the board doesn't automatically turn on when power is +applied. Instead, the user has to either toggle the ``PWR_BTN#`` line or +use any other wake-up source such as RTC alarm or Wake-on-LAN. + +eMMC Boot +--------- + +If this is set, the RCW will be fetched from the on-board eMMC at offset +1MiB. For further details, have a look at the `Reset Configuration Word +Documentation`_. + +Watchdog +-------- + +By default, the CPLD watchdog is enabled in failsafe mode. Using bits 2 and +3, the user can change its mode or disable it altogether. + +===== ===== =============================== +Bit 2 Bit 3 Description +===== ===== =============================== + 0 0 Watchdog enabled, failsafe mode + 0 1 Watchdog disabled + 1 0 Watchdog enabled, failsafe mode + 1 1 Watchdog enabled, normal mode +===== ===== =============================== + +Clock Generator Select +---------------------- + +The board is prepared to supply different SerDes clock speeds. But for now, +only setting 0 is supported, otherwise the CPU will hang because the PLL +will not lock. + +Clock Output Disable And Keep Devices In Reset +---------------------------------------------- + +To safe power, the user might disable different devices and clock output of +the board. It is not supported to disable the "CPU SerDes clock #2" for +now, otherwise the CPU will hang because the PLL will not lock. + +Automatic reset of the onboard PHYs +----------------------------------- + +By default, there is no hardware reset of the onboard PHY. This is because +for Wake-on-LAN, some registers have to retain their values. If you don't +use the WOL feature and a soft reset of the PHY is not enough you can +enable the hardware reset. The onboard PHY hardware reset follows the +power-on reset. + + +Further documentation +===================== + +- `Vendor Documentation`_ +- `Reset Configuration Word Documentation`_ + +.. _Reset Configuration Word Documentation: https://raw.githubusercontent.com/kontron/rcw-smarc-sal28/master/README.md +.. _Vendor Documentation: https://raw.githubusercontent.com/kontron/u-boot-smarc-sal28/master/board/kontron/sl28/README.mdinclude/configs/kontron_sl28.h new file +108
-1@@ -0,0 +1,108 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#ifndef __SL28_H +#define __SL28_H + +#include <asm/arch/stream_id_lsch3.h> +#include <asm/arch/config.h> +#include <asm/arch/soc.h> + +/* we don't use hwconfig but this has to be defined.. */ +#define HWCONFIG_BUFFER_SIZE 256 + +/* we don't have secure memory unless we have a BL31 */ +#ifndef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT +#undef CONFIG_SYS_MEM_RESERVE_SECURE +#endif + +/* DDR */ +#define CONFIG_DDR_ECC +#define CONFIG_ECC_INIT_VIA_DDRCONTROLLER +#define CONFIG_MEM_INIT_VALUE 0xdeadbeef + +#define CONFIG_VERY_BIG_RAM +#define CONFIG_CHIP_SELECTS_PER_CTRL 4 +#define CONFIG_DIMM_SLOTS_PER_CTLR 1 +#define CONFIG_SYS_DDR_SDRAM_BASE 0x80000000 +#define CONFIG_SYS_FSL_DDR_SDRAM_BASE_PHY 0 +#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_SDRAM_BASE +#define CONFIG_SYS_DDR_BLOCK2_BASE 0x2080000000ULL +#define CONFIG_SYS_FSL_DDR_MAIN_NUM_CTRLS 1 + +/* early stack pointer */ +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_FSL_OCRAM_BASE + 0xeff0) + +/* memtest command */ +#define CONFIG_SYS_MEMTEST_START 0x80000000 +#define CONFIG_SYS_MEMTEST_END 0x9fffffff + +/* SMP */ +#define CPU_RELEASE_ADDR secondary_boot_addr + +/* generic timer */ +#define COUNTER_FREQUENCY 25000000 + +/* size of malloc() pool */ +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2048 * 1024) + +/* early heap for SPL DM */ +#define CONFIG_MALLOC_F_ADDR CONFIG_SYS_FSL_OCRAM_BASE + +/* serial port */ +#define CONFIG_SYS_NS16550_SERIAL +#define CONFIG_SYS_NS16550_REG_SIZE 1 +#define CONFIG_SYS_NS16550_CLK (get_bus_freq(0) / 2) +#define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } + +#define CONFIG_SYS_CLK_FREQ 100000000 +#define CONFIG_DDR_CLK_FREQ 100000000 +#define COUNTER_FREQUENCY_REAL (CONFIG_SYS_CLK_FREQ / 4) + +/* MMC */ +#ifdef CONFIG_MMC +#define CONFIG_SYS_FSL_MMC_HAS_CAPBLT_VS33 +#endif + +/* ethernet */ +#define CONFIG_SYS_RX_ETH_BUFFER 8 + +/* SPL */ +#define CONFIG_SPL_BSS_START_ADDR 0x80100000 +#define CONFIG_SPL_BSS_MAX_SIZE 0x00100000 +#define CONFIG_SPL_MAX_SIZE 0x20000 +#define CONFIG_SPL_STACK (CONFIG_SYS_FSL_OCRAM_BASE + 0x9ff0) + +#define CONFIG_SYS_SPL_MALLOC_SIZE 0x00100000 +#define CONFIG_SYS_SPL_MALLOC_START 0x80200000 +#define CONFIG_SYS_MONITOR_LEN (1024 * 1024) + +/* environment */ +/* see include/configs/ti_armv7_common.h */ +#define CONFIG_SYS_LOAD_ADDR 0x82000000 +#define ENV_MEM_LAYOUT_SETTINGS \ + "loadaddr=0x82000000\0" \ + "kernel_addr_r=0x82000000\0" \ + "fdt_addr_r=0x88000000\0" \ + "bootm_size=0x10000000\0" \ + "pxefile_addr_r=0x80100000\0" \ + "scriptaddr=0x80000000\0" \ + "ramdisk_addr_r=0x88080000\0" + +#define BOOT_TARGET_DEVICES (func) \ + func(MMC, mmc, 1) \ + func(MMC, mmc, 0) \ + func(NVME, nvme, 0) \ + func(USB, usb, 0) \ + func(DHCP, dhcp, 0) \ + func(PXE, pxe, 0) +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_ENV_SETTINGS \ + "env_addr=0x203e0004\0" \ + "envload=env import -d -b ${env_addr}\0" \ + "install_rcw=source 20200000\0" \ + "fdtfile=freescale/fsl-ls1028a-kontron-sl28.dtb\0" \ + ENV_MEM_LAYOUT_SETTINGS \ + BOOTENV + +#endif /* __SL28_H */ --2.20.1
PATCH v7 2/2 board: sl28: add board specific nvm command
In reply to Michael WalleThe board supports 16 configuration bits which can be manipulated with this command. See the board's README for a detailed explanation on each bit.
--- board/kontron/sl28/Makefile | 2 +- board/kontron/sl28/cmds.c | 178 ++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 board/kontron/sl28/cmds.c
board/kontron/sl28/Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ ifndef CONFIG_SPL_BUILD -obj-y += sl28.o +obj-y += sl28.o cmds.o endif obj-y += common.o ddr.o
board/kontron/sl28/cmds.c new file +178 -0
178 lines not on this page · raw message
Signature · 1 line
2.20.1
PATCH v7 2/2 board: sl28: add board specific nvm command
Hi Michael,
Am Mo., 7. Sept. 2020 um 23:08 Uhr schrieb Michael Walle <[email protected]>:
Quoted 6 lines
The board supports 16 configuration bits which can be manipulated with this command. See the board's README for a detailed explanation on each bit.
Signed-off-by Michael Walle <[email protected]>
Quoted 203 lines
--- board/kontron/sl28/Makefile | 2 +- board/kontron/sl28/cmds.c | 178 ++++++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 board/kontron/sl28/cmds.cboard/kontron/sl28/Makefile +1
-1@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ ifndef CONFIG_SPL_BUILD -obj-y += sl28.o +obj-y += sl28.o cmds.o endif obj-y += common.o ddr.oboard/kontron/sl28/cmds.c new file +178
-0@@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* sl28 extension commands +* +* Copyright (c) 2020 Kontron Europe GmbH +*/ + +#include <common.h> +#include <command.h> +#include <i2c.h> +#include <linux/delay.h> + +#define CPLD_I2C_ADDR 0x4a +#define REG_UFM_CTRL 0x02 +#define UFM_CTRL_DCLK BIT(1) +#define UFM_CTRL_DIN BIT(2) +#define UFM_CTRL_PROGRAM BIT(3) +#define UFM_CTRL_ERASE BIT(4) +#define UFM_CTRL_DSHIFT BIT(5) +#define UFM_CTRL_DOUT BIT(6) +#define UFM_CTRL_BUSY BIT(7) + +static int ufm_shift_data (struct udevice *dev,u16 data_in,u16 *data_out) +{ +int i; +int ret; +u16 data =0 ; + +/* latch data */ + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL ,0 ); +if (ret <0 ) +return ret; + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL ,UFM_CTRL_DCLK ); +if (ret <0 ) +return ret; + +/* assert drshift */ + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL , +UFM_CTRL_DSHIFT |UFM_CTRL_DCLK ); +if (ret <0 ) +return ret; + +/* clock 16 data bits, reverse order */ +for (i =15 ; i >=0 ; i--) { +u8 din = (data_in & (1 << i)) ?UFM_CTRL_DIN :0 ; + + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL ,UFM_CTRL_DSHIFT + | din); +if (ret <0 ) +return ret; +if (data_out) { + ret =dm_i2c_reg_read (dev,REG_UFM_CTRL ); +if (ret <0 ) +return ret; +if (ret &UFM_CTRL_DOUT ) + data |= (1 << i); + } + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL , +UFM_CTRL_DSHIFT |UFM_CTRL_DCLK | din); +if (ret <0 ) +return ret; + } + +/* deassert drshift */ + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL ,UFM_CTRL_DCLK ); +if (ret <0 ) +return ret; + +if (data_out) + *data_out = data; + +return ret; +} + +static int ufm_erase (struct udevice *dev) +{ +int ret; + +/* erase, tEPMX is 500ms */ + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL , +UFM_CTRL_DCLK |UFM_CTRL_ERASE ); +if (ret <0 ) +return ret; + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL ,UFM_CTRL_DCLK ); +if (ret <0 ) +return ret; +mdelay (500 ); + +return 0 ; +} + +static int ufm_program (struct udevice *dev) +{ +int ret; + +/* program, tPPMX is 100us */ + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL , +UFM_CTRL_DCLK |UFM_CTRL_PROGRAM ); +if (ret <0 ) +return ret; + ret =dm_i2c_reg_write (dev,REG_UFM_CTRL ,UFM_CTRL_DCLK ); +if (ret <0 ) +return ret; +udelay (100 ); + +return 0 ; +} + +static int ufm_write (struct udevice *dev,u16 data) +{ +int ret; + + ret =ufm_shift_data (dev, data,NULL ); +if (ret <0 ) +return ret; + + ret =ufm_erase (dev); +if (ret <0 ) +return ret; + +return ufm_program (dev); +} + +static int ufm_read (struct udevice *dev,u16 *data) +{ +return ufm_shift_data (dev,0 , data); +} + +static int do_sl28_nvm (struct cmd_tbl *cmdtp,int flag,int argc, +char *const argv[]) +{ +struct udevice *dev; +u16 nvm; +int ret; +char *endp; + +if (i2c_get_chip_for_busnum (0 ,CPLD_I2C_ADDR ,1 , &dev)) +return CMD_RET_FAILURE ; + +if (argc >1 ) { + nvm =simple_strtoul (argv[1 ], &endp,16 ); +if (*endp !='\0' ) { +printf ("ERROR: argument is not a valid number\n" ); + ret = -EINVAL ; + goto out; + } + +/* +* We swap all bits, because the a zero bit in hardware means the +* feature is enabled. But this is hard for the user. +*/ + nvm ^=0xffff ; + + ret =ufm_write (dev, nvm); +if (ret) + goto out; +printf ("New settings will be activated after the next power cycle!\n" ); + }else { + ret =ufm_read (dev, &nvm); +if (ret) + goto out; + nvm ^=0xffff ; + +printf ("%04hx\n" , nvm); + } + +return CMD_RET_SUCCESS ; + +out: +printf ("command failed (%d)\n" , ret); +return CMD_RET_FAILURE ; +} + +static char sl28_help_text[] = +"nvm [<hex>] - display/set the 16 non-volatile bits\n" ; + +U_BOOT_CMD_WITH_SUBCMDS (sl28,"SMARC-sAL28 specific" , sl28_help_text, +U_BOOT_SUBCMD_MKENT (nvm,2 ,1 , do_sl28_nvm));
Signature · 1 line
Heiko