toradex: config block handling
Subsystems (2)
v3 cover toradex: config block handling
This series integrates Toradex factory configuration block handling. The config block is a data structure which gets stored to flash during production testing. The structure holds such information as board resp. hardware revision, product ID and serial number which is used as the NIC part of the Ethernet MAC address as well. The config block will be read upon boot by the show_board_info() function, displayed as part of the board information and passed to Linux via device tree or ATAGs.
Changes in v3:
- introduce new patch dropping unused CONFIG_CUSTOM_BOARDINFO by reverting commit a9ad18c9d5fe2554753b0f9a52adfd5ebce61147
- introduce new patch making show_board_info() a weak function which allows for custom board specific implementations thereof
- fixup deactivation of CONFIG_DISPLAY_BOARDINFO in favour of CONFIG_DISPLAY_BOARDINFO_LATE which also displays on the LCD after recent move thereof to Kconfig
- use custom show_board_info() rather than checkboard() and checkboard() rather than checkboard_fallback()
- also reword commit message accordingly
- use checkboard() rather than checkboard_fallback()
- drop CUSTOM_BOARDINFO
- drop patch 1 'colibri_imx7/vf: move to custom checkboard_fallback()' in favour of Stefan's proposed solution
Changes in v2:
- fixed common.h include mess in board/toradex/common by renaming common* to tdx-common
- renamed TRDX to TDX and trdx to tdx as in common use internally
- consolidated makefiles and changed copyright message
- renamed configblock* to tdx-cfg-block* analogous to Kconfig symbols
- moved board/toradex/common/Kconfig sourcing from arch/arm/Kconfig into our own board Kconfig files
- use a named choice for the config block location for above to work without issuing any warnings (undocumented kbuild feature curtsey Arnaud Lacombe)
- added CUSTOM_BOARDINFO into our common Kconfig to avoid recent no_new_adhoc_configs_check error
- add Max' patch
colibri_vf: usb gadget: toradex pid is now set generically
Marcel Ziswiler (6):
Revert "generic-board: allow showing custom board info"
generic-board: make show_board_info a weak function apalis/colibri_t20/t30: deactivate displaying board info
toradex: config block handling apalis/colibri_imx7/pxa270/t20/t30/vf: integrate config block handling apalis/colibri_t30: move environment location
Max Krummenacher (1):
colibri_vf: usb gadget: toradex pid is now set generically
board/toradex/apalis_t30/Kconfig | 18 + board/toradex/apalis_t30/apalis_t30.c | 12 +- board/toradex/colibri_imx7/Kconfig | 16 + board/toradex/colibri_pxa270/Kconfig | 11 + board/toradex/colibri_pxa270/colibri_pxa270.c | 8 + board/toradex/colibri_t20/Kconfig | 11 + board/toradex/colibri_t20/colibri_t20.c | 13 + board/toradex/colibri_t30/Kconfig | 18 + board/toradex/colibri_t30/colibri_t30.c | 9 +- board/toradex/colibri_vf/Kconfig | 14 + board/toradex/colibri_vf/colibri_vf.c | 16 - board/toradex/common/Kconfig | 76 ++++ board/toradex/common/Makefile | 11 + board/toradex/common/tdx-cfg-block.c | 544 ++++++++++++++++++++++++++ board/toradex/common/tdx-cfg-block.h | 68 ++++ board/toradex/common/tdx-common.c | 168 ++++++++ board/toradex/common/tdx-common.h | 13 + common/board_info.c | 4 +- configs/apalis_t30_defconfig | 1 + configs/colibri_t20_defconfig | 1 + configs/colibri_t30_defconfig | 1 + configs/colibri_vf_defconfig | 1 + include/configs/apalis_t30.h | 11 +- include/configs/colibri_imx7.h | 6 +- include/configs/colibri_pxa270.h | 7 +- include/configs/colibri_t20.h | 2 +- include/configs/colibri_t30.h | 11 +- include/configs/colibri_vf.h | 13 +- scripts/config_whitelist.txt | 5 - 29 files changed, 1041 insertions(+), 48 deletions(-) create mode 100644 board/toradex/common/Kconfig create mode 100644 board/toradex/common/Makefile create mode 100644 board/toradex/common/tdx-cfg-block.c create mode 100644 board/toradex/common/tdx-cfg-block.h create mode 100644 board/toradex/common/tdx-common.c create mode 100644 board/toradex/common/tdx-common.h
Signature · 1 line
2.5.5
PATCH v3 1/7 Revert "generic-board: allow showing custom board info"
Drop CONFIG_CUSTOM_BOARDINFO as it is not Kconfig compliant and anyway not really used anywhere plus the upcoming weak show_board_info() approach seems much superior.
This reverts commit a9ad18c9d5fe2554753b0f9a52adfd5ebce61147.
---
Changes in v3:
- introduce new patch dropping unused CONFIG_CUSTOM_BOARDINFO by reverting commit a9ad18c9d5fe2554753b0f9a52adfd5ebce61147
Changes in v2: None
common/board_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/board_info.c +1 -1
@@ -17,7 +17,7 @@ int __weak checkboard(void)*/ int show_board_info (void ) { -#if defined(CONFIG_OF_CONTROL ) && !defined(CONFIG_CUSTOM_BOARDINFO ) +#ifdef CONFIG_OF_CONTROL DECLARE_GLOBAL_DATA_PTR ;const char *model;
Signature · 1 line
2.5.5
PATCH v3 1/7 Revert "generic-board: allow showing custom board info"
Quoted 7 lines · Marcel Ziswiler
Drop
CONFIG_CUSTOM_BOARDINFOas it is notKconfigcompliant and anyway not really used anywhere plus the upcoming weakshow_board_info()approach seems much superior.This reverts commit
a9ad18c9d5fe2554753b0f9a52adfd5ebce61147.Signed-off-by Marcel Ziswiler <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161013/73a75eea/attachment.sig>
PATCH v3 2/7 generic-board: make show_board_info a weak function
In reply to Marcel ZiswilerMake show_board_info() a weak function which allows for custom board specific implementations thereof.
---
Changes in v3:
- introduce new patch making show_board_info() a weak function which allows for custom board specific implementations thereof
Changes in v2: None
common/board_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/board_info.c +1 -1
@@ -15,7 +15,7 @@ int __weak checkboard(void)* If the root node of the DTB has a "model" property, show it. * Then call checkboard(). */ -int show_board_info (void ) +int __weak show_board_info (void ) {#ifdef CONFIG_OF_CONTROL DECLARE_GLOBAL_DATA_PTR ;
Signature · 1 line
2.5.5
PATCH v3 2/7 generic-board: make show_board_info a weak function
Quoted 5 lines · Marcel Ziswiler
Make
show_board_info()a weak function which allows for custom board specific implementations thereof.Signed-off-by Marcel Ziswiler <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161013/60fff7db/attachment.sig>
PATCH v3 3/7 apalis/colibri_t20/t30: deactivate displaying board info
In reply to Marcel ZiswilerDeactivate CONFIG_DISPLAY_BOARDINFO in favour of CONFIG_DISPLAY_BOARDINFO_LATE which also displays on the LCD.
---
Changes in v3:
- fixup deactivation of CONFIG_DISPLAY_BOARDINFO in favour of CONFIG_DISPLAY_BOARDINFO_LATE which also displays on the LCD after recent move thereof to Kconfig
Changes in v2: None
configs/apalis_t30_defconfig | 1 + configs/colibri_t20_defconfig | 1 + configs/colibri_t30_defconfig | 1 + 3 files changed, 3 insertions(+)
configs/apalis_t30_defconfig +1 -0
@@ -4,6 +4,7 @@ CONFIG_TEGRA30=y CONFIG_TARGET_APALIS_T30=y CONFIG_DEFAULT_DEVICE_TREE="tegra30-apalis" CONFIG_OF_SYSTEM_SETUP=y +# CONFIG_DISPLAY_BOARDINFO is not set CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="Apalis T30 # " CONFIG_CMD_BOOTZ=y
configs/colibri_t20_defconfig +1 -0
@@ -4,6 +4,7 @@ CONFIG_TEGRA20=y CONFIG_TARGET_COLIBRI_T20=y CONFIG_DEFAULT_DEVICE_TREE="tegra20-colibri" CONFIG_OF_SYSTEM_SETUP=y +# CONFIG_DISPLAY_BOARDINFO is not set CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="Colibri T20 # " CONFIG_CMD_BOOTZ=y
configs/colibri_t30_defconfig +1 -0
@@ -4,6 +4,7 @@ CONFIG_TEGRA30=y CONFIG_TARGET_COLIBRI_T30=y CONFIG_DEFAULT_DEVICE_TREE="tegra30-colibri" CONFIG_OF_SYSTEM_SETUP=y +# CONFIG_DISPLAY_BOARDINFO is not set CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="Colibri T30 # " CONFIG_CMD_BOOTZ=y
Signature · 1 line
2.5.5
PATCH v3 4/7 toradex: config block handling
In reply to Marcel ZiswilerAdd Toradex factory configuration block handling. The config block is a data structure which gets stored to flash during production testing. The structure holds such information as board resp. hardware revision, product ID and serial number which is used as the NIC part of the Ethernet MAC address as well. The config block will be read upon boot by the show_board_info() function, displayed as part of the board information and passed to Linux via device tree or ATAGs.
---
Changes in v3:
- use custom show_board_info() rather than checkboard() and checkboard() rather than checkboard_fallback()
- also reword commit message accordingly
Changes in v2: None
board/toradex/common/Kconfig | 76 +++++ board/toradex/common/Makefile | 11 + board/toradex/common/tdx-cfg-block.c | 544 +++++++++++++++++++++++++++++++++++ board/toradex/common/tdx-cfg-block.h | 68 +++++ board/toradex/common/tdx-common.c | 168 +++++++++++ board/toradex/common/tdx-common.h | 13 + 6 files changed, 880 insertions(+) create mode 100644 board/toradex/common/Kconfig create mode 100644 board/toradex/common/Makefile create mode 100644 board/toradex/common/tdx-cfg-block.c create mode 100644 board/toradex/common/tdx-cfg-block.h create mode 100644 board/toradex/common/tdx-common.c create mode 100644 board/toradex/common/tdx-common.h
board/toradex/common/Kconfig new file +76 -0
@@ -0,0 +1,76 @@ +# Copyright (c) 2016 Toradex, Inc. +# SPDX-License-Identifier: GPL-2.0+ + +menuconfig TDX_CFG_BLOCK + bool "Enable Toradex config block support" + select OF_BOARD_SETUP + help + The Toradex config block stored production data on the on-module + flash device (NAND, NOR or eMMC). The area is normally preserved by + software and contains the serial number (out of which the MAC + address is generated) and the exact module type. + +# Helper config to determine the correct default location of the cfg block +config TDX_HAVE_MMC + bool + +config TDX_HAVE_NAND + bool + +config TDX_HAVE_NOR + bool + +if TDX_CFG_BLOCK + +choice TDX_CFG_BLOCK_LOCATION + prompt "Toradex config block location" + depends on TDX_CFG_BLOCK + default TDX_CFG_BLOCK_IS_IN_MMC if TDX_HAVE_MMC + default TDX_CFG_BLOCK_IS_IN_NAND if TDX_HAVE_NAND + default TDX_CFG_BLOCK_IS_IN_NOR if TDX_HAVE_NOR + help + Configure the location of the Toradex config block. By default, the + factory version of the Toradex config block is on the NAND, NOR or + eMMC flash device on the module. + +config TDX_CFG_BLOCK_IS_IN_MMC + bool "Location of the config block is in eMMC" + +config TDX_CFG_BLOCK_IS_IN_NAND + bool "Location of the config block is in NAND" + +config TDX_CFG_BLOCK_IS_IN_NOR + bool "Location of the config block is in NOR" + +endchoice + +config TDX_CFG_BLOCK_DEV + int "Toradex config block eMMC device ID" + depends on TDX_CFG_BLOCK_IS_IN_MMC + +config TDX_CFG_BLOCK_PART + int "Toradex config block eMMC partition ID" + depends on TDX_CFG_BLOCK_IS_IN_MMC + +config TDX_CFG_BLOCK_OFFSET + int "Toradex config block offset" + help + Specify the byte offset of the Toradex config block within the flash + device the config block is stored on. + +config TDX_CFG_BLOCK_OFFSET2 + int "Toradex config block offset, second instance" + default 0 + help + Specify the byte offset of the 2nd instance of the Toradex config block + within the flash device the config block is stored on. + Set to 0 on modules which have no 2nd instance. + +config TDX_CFG_BLOCK_2ND_ETHADDR + bool "Set the second Ethernet address" + help + For each serial number two Ethernet addresses are available for dual + Ethernet carrier boards. This options enables the code to set the + second Ethernet address as environment variable (eth1addr). + +endif
board/toradex/common/Makefile new file +11 -0
@@ -0,0 +1,11 @@ +# Copyright (c) 2016 Toradex, Inc. +# SPDX-License-Identifier: GPL-2.0+ + +# Common for all Toradex modules +ifeq ($(CONFIG_SPL_BUILD),y) +# Necessary to create built-in.o +obj- := __dummy__.o +else +obj-$(CONFIG_TDX_CFG_BLOCK) += tdx-cfg-block.o +obj-y += tdx-common.o +endif
board/toradex/common/tdx-cfg-block.c new file +544 -0
544 lines not on this page · raw message
board/toradex/common/tdx-cfg-block.h new file +68 -0
68 lines not on this page · raw message
board/toradex/common/tdx-common.c new file +168 -0
168 lines not on this page · raw message
board/toradex/common/tdx-common.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* Copyright (c) 2016 Toradex, Inc. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _TDX_COMMON_H +#define _TDX_COMMON_H + +#define TORADEX_USB_PRODUCT_NUM_OFFSET 0x4000 +#define TDX_USB_VID 0x1B67 + +#endif /* _TDX_COMMON_H */
Signature · 1 line
2.5.5
PATCH v3 5/7 apalis/colibri_imx7/pxa270/t20/t30/vf: integrate config block handling
In reply to Marcel ZiswilerWith our common code in place actually make use of it across all our modules.
---
Changes in v3:
- use checkboard() rather than checkboard_fallback()
- drop CUSTOM_BOARDINFO
Changes in v2: None
board/toradex/apalis_t30/Kconfig | 18 ++++++++++++++++++ board/toradex/apalis_t30/apalis_t30.c | 12 +++++++++++- board/toradex/colibri_imx7/Kconfig | 16 ++++++++++++++++ board/toradex/colibri_pxa270/Kconfig | 11 +++++++++++ board/toradex/colibri_pxa270/colibri_pxa270.c | 8 ++++++++ board/toradex/colibri_t20/Kconfig | 11 +++++++++++ board/toradex/colibri_t20/colibri_t20.c | 13 +++++++++++++ board/toradex/colibri_t30/Kconfig | 18 ++++++++++++++++++ board/toradex/colibri_t30/colibri_t30.c | 9 ++++++++- board/toradex/colibri_vf/Kconfig | 14 ++++++++++++++ configs/colibri_vf_defconfig | 1 + include/configs/apalis_t30.h | 4 ++-- include/configs/colibri_imx7.h | 6 +++++- include/configs/colibri_pxa270.h | 7 +++++-- include/configs/colibri_t20.h | 2 +- include/configs/colibri_t30.h | 4 ++-- include/configs/colibri_vf.h | 6 ++++-- 17 files changed, 148 insertions(+), 12 deletions(-)
board/toradex/apalis_t30/Kconfig +18 -0
@@ -9,4 +9,22 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "apalis_t30" +config TDX_CFG_BLOCK + default y + +config TDX_HAVE_MMC + default y + +config TDX_CFG_BLOCK_DEV + default "0" + +config TDX_CFG_BLOCK_PART + default "1" + +# Toradex config block in eMMC, at the end of 1st "boot sector" +config TDX_CFG_BLOCK_OFFSET + default "-512" + +source "board/toradex/common/Kconfig" + endif
board/toradex/apalis_t30/apalis_t30.c +11 -1
@@ -1,5 +1,5 @@/* -* (C) Copyright 2014 +* (C) Copyright 2014-2016 * Marcel Ziswiler <[email protected]> * * SPDX-License-Identifier: GPL-2.0+
@@ -17,6 +17,8 @@#include "pinmux-config-apalis_t30.h" +DECLARE_GLOBAL_DATA_PTR ; +#define PMU_I2C_ADDRESS 0x2D#define MAX_I2C_RETRY 3
@@ -29,6 +31,14 @@ int arch_misc_init(void)return 0 ; } +int checkboard (void ) +{ +printf ("Model: Toradex Apalis T30 %dGB\n" , + (gd->ram_size ==0x40000000 ) ?1 :2 ); + +return 0 ; +} +/* * Routine: pinmux_init * Description: Do individual peripheral pinmux configs
board/toradex/colibri_imx7/Kconfig +16 -0
@@ -16,5 +16,21 @@ config COLIBRI_IMX7_EXT_PHYCLK clock source. default y +config TDX_CFG_BLOCK + default y + +config TDX_HAVE_NAND + default y + +config TDX_CFG_BLOCK_OFFSET + default "2048" + +config TDX_CFG_BLOCK_OFFSET2 + default "133120" + +config TDX_CFG_BLOCK_2ND_ETHADDR + default y + +source "board/toradex/common/Kconfig" endif
board/toradex/colibri_pxa270/Kconfig +11 -0
@@ -9,4 +9,15 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "colibri_pxa270" +config TDX_CFG_BLOCK + default y + +config TDX_HAVE_NOR + default y + +config TDX_CFG_BLOCK_OFFSET + default "262144" + +source "board/toradex/common/Kconfig" + endif
board/toradex/colibri_pxa270/colibri_pxa270.c +8 -0
@@ -2,6 +2,7 @@* Toradex Colibri PXA270 Support * * Copyright (C) 2010 Marek Vasut <[email protected]> +* Copyright (C) 2016 Marcel Ziswiler <[email protected]> * * SPDX-License-Identifier: GPL-2.0+ */
@@ -32,6 +33,13 @@ int board_init(void)return 0 ; } +int checkboard (void ) +{ +puts ("Model: Toradex Colibri PXA270\n" ); + +return 0 ; +} +int dram_init (void ) {pxa2xx_dram_init ();
board/toradex/colibri_t20/Kconfig +11 -0
@@ -9,4 +9,15 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "colibri_t20" +config TDX_CFG_BLOCK + default y + +config TDX_HAVE_NAND + default y + +config TDX_CFG_BLOCK_OFFSET + default "3145728" + +source "board/toradex/common/Kconfig" + endif
board/toradex/colibri_t20/colibri_t20.c +13 -0
@@ -14,6 +14,9 @@#include <asm/gpio.h> #include <asm/io.h> #include <i2c.h> +#include <nand.h> + +DECLARE_GLOBAL_DATA_PTR ;#define PMU_I2C_ADDRESS 0x34#define MAX_I2C_RETRY 3
@@ -61,6 +64,16 @@ int arch_misc_init(void)return 0 ; } +int checkboard (void ) +{ +printf ("Model: Toradex Colibri T20 %dMB V%s\n" , + (gd->ram_size ==0x10000000 ) ?256 :512 , + (nand_info[0 ]->erasesize >>10 ==512 ) ? + ((gd->ram_size ==0x10000000 ) ?"1.1B" :"1.1C" ) :"1.2A" ); + +return 0 ; +} +#ifdef CONFIG_TEGRA_MMC /* * Routine: pin_mux_mmc
board/toradex/colibri_t30/Kconfig +18 -0
@@ -9,4 +9,22 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "colibri_t30" +config TDX_CFG_BLOCK + default y + +config TDX_HAVE_MMC + default y + +config TDX_CFG_BLOCK_DEV + default "0" + +config TDX_CFG_BLOCK_PART + default "1" + +# Toradex config block in eMMC, at the end of 1st "boot sector" +config TDX_CFG_BLOCK_OFFSET + default "-512" + +source "board/toradex/common/Kconfig" + endif
board/toradex/colibri_t30/colibri_t30.c +8 -1
@@ -1,5 +1,5 @@/* -* (C) Copyright 2014 +* (C) Copyright 2014-2016 * Stefan Agner <[email protected]> * * SPDX-License-Identifier: GPL-2.0+
@@ -24,6 +24,13 @@ int arch_misc_init(void)return 0 ; } +int checkboard (void ) +{ +puts ("Model: Toradex Colibri T30 1GB\n" ); + +return 0 ; +} +/* * Routine: pinmux_init * Description: Do individual peripheral pinmux configs
board/toradex/colibri_vf/Kconfig +14 -0
@@ -15,4 +15,18 @@ config SYS_SOC config SYS_CONFIG_NAME default "colibri_vf" +config TDX_CFG_BLOCK + default y + +config TDX_HAVE_NAND + default y + +config TDX_CFG_BLOCK_OFFSET + default "2048" + +config TDX_CFG_BLOCK_2ND_ETHADDR + default y + +source "board/toradex/common/Kconfig" + endif
configs/colibri_vf_defconfig +1 -0
@@ -4,6 +4,7 @@ CONFIG_DEFAULT_DEVICE_TREE="vf610-colibri" CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,ENV_IS_IN_NAND,IMX_NAND" CONFIG_BOOTDELAY=1 CONFIG_VERSION_VARIABLE=y +# CONFIG_DISPLAY_BOARDINFO is not set CONFIG_HUSH_PARSER=y CONFIG_SYS_PROMPT="Colibri VFxx # " CONFIG_CMD_BOOTZ=y
include/configs/apalis_t30.h +2 -2
@@ -1,5 +1,5 @@/* -* Copyright (c) 2014-2015 Marcel Ziswiler +* Copyright (c) 2014-2016 Marcel Ziswiler * * Configuration settings for the Toradex Apalis T30 modules. *
@@ -16,7 +16,7 @@#define CONFIG_ARCH_MISC_INIT /* High-level configuration options */ -#define CONFIG_TEGRA_BOARD_STRING "Toradex Apalis T30" +#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ /* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTA
include/configs/colibri_imx7.h +5 -1
@@ -21,10 +21,14 @@/*#define CONFIG_DBG_MONITOR*/ #define PHYS_SDRAM_SIZE SZ_512M +#define CONFIG_ARCH_MISC_INIT #define CONFIG_BOARD_EARLY_INIT_F #define CONFIG_BOARD_LATE_INIT -#define CONFIG_DISPLAY_BOARDINFO_LATE +#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ + +#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG /* Size of malloc() pool */ #define CONFIG_SYS_MALLOC_LEN (32 * SZ_1M)
include/configs/colibri_pxa270.h +5 -2
@@ -2,7 +2,7 @@* Toradex Colibri PXA270 configuration file * * Copyright (C) 2010 Marek Vasut <[email protected]> -* Copyright (C) 2015 Marcel Ziswiler <[email protected]> +* Copyright (C) 2015-2016 Marcel Ziswiler <[email protected]> * * SPDX-License-Identifier: GPL-2.0+ */
@@ -21,10 +21,14 @@/* We will never enable dcache because we have to setup MMU first */ #define CONFIG_SYS_DCACHE_OFF +#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ +/* * Environment settings */ #define CONFIG_ENV_OVERWRITE +#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_SYS_MALLOC_LEN (128 * 1024)#define CONFIG_ARCH_CPU_INIT #define CONFIG_BOOTCOMMAND \
@@ -39,7 +43,6 @@#define CONFIG_TIMESTAMP #define CONFIG_CMDLINE_TAG #define CONFIG_SETUP_MEMORY_TAGS -#define CONFIG_LZMA /* LZMA compression support */ /* * Serial Console Configuration
include/configs/colibri_t20.h +1 -1
@@ -14,7 +14,7 @@#define CONFIG_ARCH_MISC_INIT /* High-level configuration options */ -#define CONFIG_TEGRA_BOARD_STRING "Toradex Colibri T20" +#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ /* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTA
include/configs/colibri_t30.h +2 -2
@@ -1,5 +1,5 @@/* -* Copyright (c) 2013-2015 Stefan Agner +* Copyright (c) 2013-2016 Stefan Agner * * Configuration settings for the Toradex Colibri T30 modules. *
@@ -16,7 +16,7 @@#define CONFIG_ARCH_MISC_INIT /* High-level configuration options */ -#define CONFIG_TEGRA_BOARD_STRING "Toradex Colibri T30" +#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ /* Board-specific serial config */ #define CONFIG_TEGRA_ENABLE_UARTA
include/configs/colibri_vf.h +4 -2
@@ -1,7 +1,7 @@/* -* Copyright 2015 Toradex, Inc. +* Copyright 2015-2016 Toradex, Inc. * -* Configuration settings for the Toradex VF50/VF61 module. +* Configuration settings for the Toradex VF50/VF61 modules. * * Based on vf610twr.h: * Copyright 2013 Freescale Semiconductor, Inc.
@@ -21,6 +21,7 @@#define CONFIG_SYS_FSL_CLK #define CONFIG_ARCH_MISC_INIT +#define CONFIG_DISPLAY_BOARDINFO_LATE /* Calls show_board_info() */ #define CONFIG_SKIP_LOWLEVEL_INIT
@@ -36,6 +37,7 @@/* Allow to overwrite serial and ethaddr */ #define CONFIG_ENV_OVERWRITE +#define CONFIG_ENV_VARS_UBOOT_CONFIG #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_BAUDRATE 115200
Signature · 1 line
2.5.5
PATCH v3 6/7 apalis/colibri_t30: move environment location
In reply to Marcel ZiswilerNow with the config block handling in place move the U-Boot environment location before the config block at the end of 1st "boot sector" as deployed during production using our downstream BSP.
---
Changes in v3:
- drop patch 1 'colibri_imx7/vf: move to custom checkboard_fallback()' in favour of Stefan's proposed solution
Changes in v2:
- fixed common.h include mess in board/toradex/common by renaming common* to tdx-common
- renamed TRDX to TDX and trdx to tdx as in common use internally
- consolidated makefiles and changed copyright message
- renamed configblock* to tdx-cfg-block* analogous to Kconfig symbols
- moved board/toradex/common/Kconfig sourcing from arch/arm/Kconfig into our own board Kconfig files
- use a named choice for the config block location for above to work without issuing any warnings (undocumented kbuild feature curtsey Arnaud Lacombe)
- added CUSTOM_BOARDINFO into our common Kconfig to avoid recent no_new_adhoc_configs_check error
- add Max' patch
colibri_vf: usb gadget: toradex pid is now set generically
include/configs/apalis_t30.h | 7 ++++--- include/configs/colibri_t30.h | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-)
include/configs/apalis_t30.h +4 -3
@@ -32,11 +32,12 @@#define CONFIG_GENERIC_MMC #define CONFIG_TEGRA_MMC -/* Environment in eMMC, at the end of 2nd "boot sector" */ +/* Environment in eMMC, before config block at the end of 1st "boot sector" */ #define CONFIG_ENV_IS_IN_MMC -#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE) +#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ + CONFIG_TDX_CFG_BLOCK_OFFSET)#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_SYS_MMC_ENV_PART 2 +#define CONFIG_SYS_MMC_ENV_PART 1/* USB host support */ #define CONFIG_USB_EHCI
include/configs/colibri_t30.h +4 -3
@@ -32,11 +32,12 @@#define CONFIG_GENERIC_MMC #define CONFIG_TEGRA_MMC -/* Environment in eMMC, at the end of 2nd "boot sector" */ +/* Environment in eMMC, before config block at the end of 1st "boot sector" */ #define CONFIG_ENV_IS_IN_MMC -#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE) +#define CONFIG_ENV_OFFSET (-CONFIG_ENV_SIZE + \ + CONFIG_TDX_CFG_BLOCK_OFFSET)#define CONFIG_SYS_MMC_ENV_DEV 0 -#define CONFIG_SYS_MMC_ENV_PART 2 +#define CONFIG_SYS_MMC_ENV_PART 1/* USB host support */ #define CONFIG_USB_EHCI
Signature · 1 line
2.5.5
PATCH v3 7/7 colibri_vf: usb gadget: toradex pid is now set generically
In reply to Marcel ZiswilerFrom: Max Krummenacher <[email protected]>
remove now unused CONFIG_TRDX_PID_XXX
---
Changes in v3: None
Changes in v2: None
board/toradex/colibri_vf/colibri_vf.c | 16 ---------------- include/configs/colibri_vf.h | 7 ------- scripts/config_whitelist.txt | 5 ----- 3 files changed, 28 deletions(-)
board/toradex/colibri_vf/colibri_vf.c +0 -16
@@ -528,22 +528,6 @@ int checkboard(void)return 0 ; } -int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name) -{ -unsigned short usb_pid; - -put_unaligned (CONFIG_TRDX_VID , &dev->idVendor); - -if (is_colibri_vf61 ()) - usb_pid =CONFIG_TRDX_PID_COLIBRI_VF61IT ; -else - usb_pid =CONFIG_TRDX_PID_COLIBRI_VF50IT ; - -put_unaligned (usb_pid, &dev->idProduct); - -return 0 ; -} -#ifdef CONFIG_USB_EHCI_VF int board_ehci_hcd_init (int port) {
include/configs/colibri_vf.h +0 -7
@@ -208,13 +208,6 @@#define CONFIG_USB_MAX_CONTROLLER_COUNT 2#define CONFIG_EHCI_HCD_INIT_AFTER_RESET -/* USB Client Support */ -#define CONFIG_TRDX_VID 0x1B67 -#define CONFIG_TRDX_PID_COLIBRI_VF50 0x0016 -#define CONFIG_TRDX_PID_COLIBRI_VF61 0x0017 -#define CONFIG_TRDX_PID_COLIBRI_VF61IT 0x0018 -#define CONFIG_TRDX_PID_COLIBRI_VF50IT 0x0019 -/* USB DFU */ #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)
scripts/config_whitelist.txt +0 -5
@@ -8010,11 +8010,6 @@ CONFIG_TRACE_EARLY_ADDR CONFIG_TRACE_EARLY_SIZE CONFIG_TRAILBLAZER CONFIG_TRATS -CONFIG_TRDX_PID_COLIBRI_VF50 -CONFIG_TRDX_PID_COLIBRI_VF50IT -CONFIG_TRDX_PID_COLIBRI_VF61 -CONFIG_TRDX_PID_COLIBRI_VF61IT -CONFIG_TRDX_VID CONFIG_TSEC CONFIG_TSEC1 CONFIG_TSEC1_NAME
Signature · 1 line
2.5.5
PATCH v3 7/7 colibri_vf: usb gadget: toradex pid is now set generically
Quoted 3 lines · Marcel Ziswiler
From: Max Krummenacher <[email protected]>
remove now unused
CONFIG_TRDX_PID_XXX
With config block support, we can elaborate the exact module precisely, so removing the old approach makes sense.
--
Stefan
Quoted 73 lines
Signed-off-by Marcel Ziswiler <[email protected]>---
Changes in v3: None
Changes in v2: Noneboard/toradex/colibri_vf/colibri_vf.c | 16 ---------------- include/configs/colibri_vf.h | 7 ------- scripts/config_whitelist.txt | 5 ----- 3 files changed, 28 deletions(-)board/toradex/colibri_vf/colibri_vf.c +0
-16@@ -528,22 +528,6 @@ int checkboard(void)return 0 ; } -int g_dnl_bind_fixup (struct usb_device_descriptor *dev,const char *name) -{ -unsigned short usb_pid; - -put_unaligned (CONFIG_TRDX_VID , &dev->idVendor); - -if (is_colibri_vf61 ()) - usb_pid =CONFIG_TRDX_PID_COLIBRI_VF61IT ; -else - usb_pid =CONFIG_TRDX_PID_COLIBRI_VF50IT ; - -put_unaligned (usb_pid, &dev->idProduct); - -return 0 ; -} -#ifdef CONFIG_USB_EHCI_VF int board_ehci_hcd_init (int port) {include/configs/colibri_vf.h +0
-7@@ -208,13 +208,6 @@#define CONFIG_USB_MAX_CONTROLLER_COUNT 2#define CONFIG_EHCI_HCD_INIT_AFTER_RESET -/* USB Client Support */ -#define CONFIG_TRDX_VID 0x1B67 -#define CONFIG_TRDX_PID_COLIBRI_VF50 0x0016 -#define CONFIG_TRDX_PID_COLIBRI_VF61 0x0017 -#define CONFIG_TRDX_PID_COLIBRI_VF61IT 0x0018 -#define CONFIG_TRDX_PID_COLIBRI_VF50IT 0x0019 -/* USB DFU */ #define CONFIG_SYS_DFU_DATA_BUF_SIZE (1024 * 1024)scripts/config_whitelist.txt +0
-5@@ -8010,11 +8010,6 @@ CONFIG_TRACE_EARLY_ADDR CONFIG_TRACE_EARLY_SIZE CONFIG_TRAILBLAZER CONFIG_TRATS -CONFIG_TRDX_PID_COLIBRI_VF50 -CONFIG_TRDX_PID_COLIBRI_VF50IT -CONFIG_TRDX_PID_COLIBRI_VF61 -CONFIG_TRDX_PID_COLIBRI_VF61IT -CONFIG_TRDX_VID CONFIG_TSEC CONFIG_TSEC1 CONFIG_TSEC1_NAME
v3 cover toradex: config block handling
In reply to Marcel ZiswilerQuoted 12 lines · Marcel Ziswiler
This series integrates Toradex factory configuration block handling. The
config block is a data structure which gets stored to flash during production testing. The structure holds such information as board resp.
hardware revision, product ID and serial number which is used as the NIC
part of the Ethernet MAC address as well. The config block will be read
upon boot by theshow_board_info()function, displayed as part of the board information and passed to Linux via device tree or ATAGs.
Quoted 16 lines
Changes in v3:
- introduce new patch dropping unusedCONFIG_CUSTOM_BOARDINFOby ? reverting commita9ad18c9d5fe2554753b0f9a52adfd5ebce61147
- introduce new patch makingshow_board_info()a weak function which ? allows for custom board specific implementations thereof
- fixup deactivation ofCONFIG_DISPLAY_BOARDINFOin favour of ?CONFIG_DISPLAY_BOARDINFO_LATEwhich also displays on the LCD after ? recent move thereof toKconfig
- use customshow_board_info()rather thancheckboard()and ?checkboard()rather thancheckboard_fallback()
- also reword commit message accordingly
- usecheckboard()rather thancheckboard_fallback()
- dropCUSTOM_BOARDINFO
- drop patch 1 'colibri_imx7/vf: move to customcheckboard_fallback()'
? in favour of Stefan's proposed solution
Whole series:
Quoted 67 lines
Changes in v2:
- fixedcommon.hinclude mess in board/toradex/common by renaming ? common* to tdx-common
- renamed TRDX to TDX and trdx to tdx as in common use internally
- consolidated makefiles and changed copyright message
- renamed configblock* to tdx-cfg-block* analogous toKconfigsymbols
- moved board/toradex/common/Kconfig sourcing fromarch/arm/Kconfig? into our own boardKconfigfiles
- use a named choice for the config block location for above to work ? without issuing any warnings (undocumented kbuild feature curtsey ? Arnaud Lacombe)
- addedCUSTOM_BOARDINFOinto our commonKconfigto avoid recent ?no_new_adhoc_configs_checkerror
- add Max' patch
?colibri_vf: usb gadget: toradex pid is now set genericallyMarcel Ziswiler (6):
? Revert "generic-board: allow showing custom board info" ? generic-board: makeshow_board_infoa weak function ? apalis/colibri_t20/t30: deactivate displaying board info ? toradex: config block handling
? apalis/colibri_imx7/pxa270/t20/t30/vf: integrate config block handling
? apalis/colibri_t30: move environment locationMax Krummenacher (1):
?colibri_vf: usb gadget: toradex pid is now set generically?board/toradex/apalis_t30/Kconfig??????????????|??18 + ?board/toradex/apalis_t30/apalis_t30.c?????????|??12 +- ?board/toradex/colibri_imx7/Kconfig????????????|??16 + ?board/toradex/colibri_pxa270/Kconfig??????????|??11 + ?board/toradex/colibri_pxa270/colibri_pxa270.c |???8 + ?board/toradex/colibri_t20/Kconfig?????????????|??11 + ?board/toradex/colibri_t20/colibri_t20.c???????|??13 + ?board/toradex/colibri_t30/Kconfig?????????????|??18 + ?board/toradex/colibri_t30/colibri_t30.c???????|???9 +- ?board/toradex/colibri_vf/Kconfig??????????????|??14 + ?board/toradex/colibri_vf/colibri_vf.c?????????|??16 - ?board/toradex/common/Kconfig??????????????????|??76 ++++ ?board/toradex/common/Makefile?????????????????|??11 + ?board/toradex/common/tdx-cfg-block.c??????????| 544 ++++++++++++++++++++++++++ ?board/toradex/common/tdx-cfg-block.h??????????|??68 ++++ ?board/toradex/common/tdx-common.c?????????????| 168 ++++++++ ?board/toradex/common/tdx-common.h?????????????|??13 + ?common/board_info.c???????????????????????????|???4 +- ?configs/apalis_t30_defconfig??????????????????|???1 + ?configs/colibri_t20_defconfig?????????????????|???1 + ?configs/colibri_t30_defconfig?????????????????|???1 + ?configs/colibri_vf_defconfig??????????????????|???1 + ?include/configs/apalis_t30.h??????????????????|??11 +- ?include/configs/colibri_imx7.h????????????????|???6 +- ?include/configs/colibri_pxa270.h??????????????|???7 +- ?include/configs/colibri_t20.h?????????????????|???2 +- ?include/configs/colibri_t30.h?????????????????|??11 +- ?include/configs/colibri_vf.h??????????????????|??13 +- ?scripts/config_whitelist.txt??????????????????|???5 -?29 files changed, 1041 insertions(+), 48 deletions(-) ?create mode 100644 board/toradex/common/Kconfig ?create mode 100644 board/toradex/common/Makefile ?create mode 100644
board/toradex/common/tdx-cfg-block.c?create mode 100644board/toradex/common/tdx-cfg-block.h?create mode 100644board/toradex/common/tdx-common.c?create mode 100644board/toradex/common/tdx-common.h