Introduce B1x5v2 support
v4 cover Introduce B1x5v2 support
This series introduces support for a new i.MX6DL based GE patient monitor series.
Patch 1: Add support for storing bootcount in SPI-flash Patch 2+3: Improve M41T62 RTC driver's reset routine. PATCH 4: Support disable_ldb_di_clock_sources for i.MX6DL Patch 5: Add poweroff-gpio support
Patch 6-8: restructure common GE code
Patch 9: Add the actual board, using SPL and DM
Changes since PATCHv3 [0]:
* Dropped patch for reading DR for i.MX GPIOs and set SION pinmux bits in B1x5v2 output GPIOs instead
* Rebased to v2020.10-rc3
Changes since PATCHv2:
* PATCH 10: Fixed network phy mode ("rgmii" -> "rgmii-id")
* PATCH 6: Fixed nits reported by Simon Glass and added is Reviewed-by Tag.
Changes since PATCHv1:
* Rebased to v2020.10-rc2
* Original patch 1 (support for DM_SPI_FLASH with non-DM SPL) has been dropped, since a similar patch has been merged in the meantime
* poweroff-gpio support is now added using sysreset uclass instead of introducing a new poweroff uclass
* B1x5v2 patch has been updated to follow recent U-Boot changes and to add USB mass storage support
[0] http://patchwork.ozlabs.org/project/uboot/list/?series=196979
-- Sebastian
Sebastian Reichel (9):
bootcount: add a DM SPI flash backing store for bootcount
rtc: m41t62: reset SQW in m41t62_rtc_reset
rtc: m41t62: add oscillator fail bit reset support
imx6: allow usage of disable_ldb_di_clock_sources for CONFIG_MX6QDL
sysreset: Add poweroff-gpio driver
board: ge: common: rename ge_common.c to ge_rtc.c
board: ge: common: add config option for RTC and VPD feature
board: ge: common: vpd: separate I2C specific code
board: ge: b1x5v2: Add GE B1x5v2 and B1x5Pv2
arch/arm/dts/Makefile | 1 +
arch/arm/dts/imx6dl-b1x5v2.dts | 654 ++++++++++++++++++++
arch/arm/mach-imx/mx6/Kconfig | 9 +
arch/arm/mach-imx/mx6/clock.c | 2 +-
board/ge/b1x5v2/Kconfig | 14 +
board/ge/b1x5v2/Makefile | 6 +
board/ge/b1x5v2/b1x5v2.c | 698 ++++++++++++++++++++++
board/ge/b1x5v2/spl.c | 587 ++++++++++++++++++
board/ge/bx50v3/Kconfig | 2 +
board/ge/bx50v3/bx50v3.c | 4 +-
board/ge/common/Kconfig | 7 +
board/ge/common/Makefile | 3 +-
board/ge/common/{ge_common.c => ge_rtc.c} | 0
board/ge/common/{ge_common.h => ge_rtc.h} | 0
board/ge/common/vpd_reader.c | 12 +-
board/ge/common/vpd_reader.h | 23 +-
board/ge/mx53ppd/Kconfig | 2 +
board/ge/mx53ppd/mx53ppd.c | 4 +-
configs/ge_b1x5v2_defconfig | 137 +++++
drivers/bootcount/Kconfig | 10 +
drivers/bootcount/Makefile | 1 +
drivers/bootcount/spi-flash.c | 125 ++++
drivers/rtc/m41t62.c | 139 ++++-
drivers/sysreset/Kconfig | 7 +
drivers/sysreset/Makefile | 1 +
drivers/sysreset/poweroff_gpio.c | 92 +++
include/configs/ge_b1x5v2.h | 127 ++++
27 files changed, 2645 insertions(+), 22 deletions(-)
create mode 100644 arch/arm/dts/imx6dl-b1x5v2.dts
create mode 100644 board/ge/b1x5v2/Kconfig
create mode 100644 board/ge/b1x5v2/Makefile
create mode 100644 board/ge/b1x5v2/b1x5v2.c
create mode 100644 board/ge/b1x5v2/spl.c
create mode 100644 board/ge/common/Kconfig
rename board/ge/common/{ge_common.c => ge_rtc.c} (100%)
rename board/ge/common/{ge_common.h => ge_rtc.h} (100%)
create mode 100644 configs/ge_b1x5v2_defconfig
create mode 100644 drivers/bootcount/spi-flash.c
create mode 100644 drivers/sysreset/poweroff_gpio.c
create mode 100644 include/configs/ge_b1x5v2.hSignature · 1 line
2.28.0
PATCH v4 1/9 bootcount: add a DM SPI flash backing store for bootcount
This driver allows to use SPI flash as backing store for boot counter values with DM enabled.
--- drivers/bootcount/Kconfig | 10 +++ drivers/bootcount/Makefile | 1 + drivers/bootcount/spi-flash.c | 125 ++++++++++++++++++++++++++++++++++ 3 files changed, 136 insertions(+) create mode 100644 drivers/bootcount/spi-flash.c
drivers/bootcount/Kconfig +10 -0
@@ -108,6 +108,16 @@ config DM_BOOTCOUNT_I2C_EEPROM pointing to the underlying i2c eeprom device) and an optional 'offset' property are supported. +config DM_BOOTCOUNT_SPI_FLASH + bool "Support SPI flash devices as a backing store for bootcount" + depends on DM_SPI_FLASH + help + Enabled reading/writing the bootcount in a DM SPI flash device. + The wrapper device is to be specified with the compatible string + 'u-boot,bootcount-spi-flash' and the 'spi-flash'-property (a phandle + pointing to the underlying SPI flash device) and an optional 'offset' + property are supported. + config BOOTCOUNT_MEM bool "Support memory based bootcounter" help
drivers/bootcount/Makefile +1 -0
@@ -12,3 +12,4 @@ obj-$(CONFIG_BOOTCOUNT_EXT) += bootcount_ext.o obj-$(CONFIG_DM_BOOTCOUNT) += bootcount-uclass.o obj-$(CONFIG_DM_BOOTCOUNT_RTC) += rtc.o obj-$(CONFIG_DM_BOOTCOUNT_I2C_EEPROM) += i2c-eeprom.o +obj-$(CONFIG_DM_BOOTCOUNT_SPI_FLASH) += spi-flash.o
drivers/bootcount/spi-flash.c new file +125 -0
125 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v4 1/9 bootcount: add a DM SPI flash backing store for bootcount
Quoted 3 lines
This driver allows to use SPI flash as backing store for boot counter values with DM enabled.
Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 2/9 rtc: m41t62: reset SQW in m41t62_rtc_reset
In reply to Sebastian ReichelThis takes care of resetting the 32kHz square wave, which is used by some boards as clock source for the SoC.
--- drivers/rtc/m41t62.c | 89 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 6 deletions(-)
drivers/rtc/m41t62.c +83 -6
@@ -22,6 +22,7 @@#include <log.h> #include <rtc.h> #include <i2c.h> +#include <linux/log2.h> #define M41T62_REG_SSEC 0#define M41T62_REG_SEC 1
@@ -49,6 +50,11 @@#define M41T62_FLAGS_AF (1 << 6)/* AF: Alarm Flag Bit */ #define M41T62_FLAGS_BATT_LOW (1 << 4)/* BL: Battery Low Bit */ +#define M41T62_WDAY_SQW_FREQ_MASK 0xf0 +#define M41T62_WDAY_SQW_FREQ_SHIFT 4 + +#define M41T62_SQW_MAX_FREQ 32768 +#define M41T62_FEATURE_HT (1 << 0)#define M41T62_FEATURE_BL (1 << 1)
@@ -139,21 +145,92 @@ static int m41t62_rtc_set(struct udevice *dev, const struct rtc_time *tm)return 0 ; } -static int m41t62_rtc_reset (struct udevice *dev) +static int m41t62_sqw_enable (struct udevice *dev,bool enable) +{ +u8 val; +int ret; + + ret =dm_i2c_read (dev,M41T62_REG_ALARM_MON , &val,sizeof (val)); +if (ret) +return ret; + +if (enable) + val |=M41T62_ALMON_SQWE ; +else + val &= ~M41T62_ALMON_SQWE ; + +return dm_i2c_write (dev,M41T62_REG_ALARM_MON , &val,sizeof (val)); +} + +static int m41t62_sqw_set_rate (struct udevice *dev,unsigned int rate) +{ +u8 val, newval, sqwrateval; +int ret; + +if (rate >=M41T62_SQW_MAX_FREQ ) + sqwrateval =1 ; +else if (rate >=M41T62_SQW_MAX_FREQ /4 ) + sqwrateval =2 ; +else if (rate) + sqwrateval =15 -ilog2 (rate); + + ret =dm_i2c_read (dev,M41T62_REG_WDAY , &val,sizeof (val)); +if (ret) +return ret; + + newval = val; + newval &= ~M41T62_WDAY_SQW_FREQ_MASK ; + newval |= (sqwrateval <<M41T62_WDAY_SQW_FREQ_SHIFT ); + +/* +* Try to avoid writing unchanged values. Writing to this register +* will reset the internal counter pipeline and thus affect system +* time. +*/ +if (newval == val) +return 0 ; + +return dm_i2c_write (dev,M41T62_REG_WDAY , &newval,sizeof (newval)); +} + +static int m41t62_rtc_clear_ht (struct udevice *dev) {u8 val; +int ret;/* * M41T82: Make sure HT (Halt Update) bit is cleared. * This bit is 0 in M41T62 so its save to clear it always. */ -int ret =dm_i2c_read (dev,M41T62_REG_ALARM_HOUR , &val,sizeof (val)); - + ret =dm_i2c_read (dev,M41T62_REG_ALARM_HOUR , &val,sizeof (val)); +if (ret) +return ret; val &= ~M41T80_ALHOUR_HT ; - ret |=dm_i2c_write (dev,M41T62_REG_ALARM_HOUR , &val,sizeof (val)); + ret =dm_i2c_write (dev,M41T62_REG_ALARM_HOUR , &val,sizeof (val)); +if (ret) +return ret; + +return 0 ; +} -return ret; +static int m41t62_rtc_reset (struct udevice *dev) +{ +int ret; + + ret =m41t62_rtc_clear_ht (dev); +if (ret) +return ret; + +/* +* Some boards feed the square wave as clock input into +* the SoC. This enables a 32.768kHz square wave, which is +* also the hardware default after power-loss. +*/ + ret =m41t62_sqw_set_rate (dev,32768 ); +if (ret) +return ret; +return m41t62_sqw_enable (dev, true); }/*
@@ -162,7 +239,7 @@ static int m41t62_rtc_reset(struct udevice *dev)*/ static int m41t62_rtc_probe (struct udevice *dev) { -return m41t62_rtc_reset (dev); +return m41t62_rtc_clear_ht (dev); }static const struct rtc_ops m41t62_rtc_ops = {
Signature · 1 line
2.28.0
PATCH v4 2/9 rtc: m41t62: reset SQW in m41t62_rtc_reset
Quoted 3 lines
This takes care of resetting the 32kHz square wave, which is used by some boards as clock source for the SoC.
Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 3/9 rtc: m41t62: add oscillator fail bit reset support
In reply to Sebastian ReichelIn case of empty battery or glitches the oscillator fail bit might be set. This will reset the bit in the reset routine.
--- drivers/rtc/m41t62.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
drivers/rtc/m41t62.c +50 -0
@@ -23,6 +23,7 @@#include <rtc.h> #include <i2c.h> #include <linux/log2.h> +#include <linux/delay.h> #define M41T62_REG_SSEC 0#define M41T62_REG_SEC 1
@@ -48,6 +49,7 @@#define M41T62_ALMON_SQWE (1 << 6)/* SQWE: SQW Enable Bit */ #define M41T62_ALHOUR_HT (1 << 6)/* HT: Halt Update Bit */ #define M41T62_FLAGS_AF (1 << 6)/* AF: Alarm Flag Bit */ +#define M41T62_FLAGS_OF (1 << 2)/* OF: Oscillator Flag Bit */ #define M41T62_FLAGS_BATT_LOW (1 << 4)/* BL: Battery Low Bit */ #define M41T62_WDAY_SQW_FREQ_MASK 0xf0
@@ -193,6 +195,50 @@ static int m41t62_sqw_set_rate(struct udevice *dev, unsigned int rate)return dm_i2c_write (dev,M41T62_REG_WDAY , &newval,sizeof (newval)); } +static int m41t62_rtc_restart_osc (struct udevice *dev) +{ +u8 val; +int ret; + +/* 0. check if oscillator failure happened */ + ret =dm_i2c_read (dev,M41T62_REG_FLAGS , &val,sizeof (val)); +if (ret) +return ret; +if (!(val &M41T62_FLAGS_OF )) +return 0 ; + + ret =dm_i2c_read (dev,M41T62_REG_SEC , &val,sizeof (val)); +if (ret) +return ret; + +/* 1. Set stop bit */ + val |=M41T62_SEC_ST ; + ret =dm_i2c_write (dev,M41T62_REG_ALARM_HOUR , &val,sizeof (val)); +if (ret) +return ret; + +/* 2. Clear stop bit */ + val &= ~M41T62_SEC_ST ; + ret =dm_i2c_write (dev,M41T62_REG_ALARM_HOUR , &val,sizeof (val)); +if (ret) +return ret; + +/* 3. wait 4 seconds */ +mdelay (4000 ); + + ret =dm_i2c_read (dev,M41T62_REG_FLAGS , &val,sizeof (val)); +if (ret) +return ret; + +/* 4. clear M41T62_FLAGS_OF bit */ + val &= ~M41T62_FLAGS_OF ; + ret =dm_i2c_write (dev,M41T62_REG_FLAGS , &val,sizeof (val)); +if (ret) +return ret; + +return 0 ; +} +static int m41t62_rtc_clear_ht (struct udevice *dev) {u8 val;
@@ -218,6 +264,10 @@ static int m41t62_rtc_reset(struct udevice *dev) {int ret; + ret =m41t62_rtc_restart_osc (dev); +if (ret) +return ret; + ret =m41t62_rtc_clear_ht (dev);if (ret)return ret;
Signature · 1 line
2.28.0
PATCH v4 3/9 rtc: m41t62: add oscillator fail bit reset support
Quoted 4 lines
In case of empty battery or glitches the oscillator fail bit might be set. This will reset the bit in the reset routine.
Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 4/9 imx6: allow usage of disable_ldb_di_clock_sources for CONFIG_MX6QDL
In reply to Sebastian ReichelAllow using disable_ldb_di_clock_sources with just the combined CONFIG_MX6QDL being enabled.
--- arch/arm/mach-imx/mx6/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/clock.c +1 -1
@@ -1341,7 +1341,7 @@ int do_mx6_showclocks(struct cmd_tbl *cmdtp, int flag, int argc, }#if defined(CONFIG_MX6Q ) || defined(CONFIG_MX6D ) || defined(CONFIG_MX6DL ) || \ - defined(CONFIG_MX6S ) + defined(CONFIG_MX6S ) || defined(CONFIG_MX6QDL )static void disable_ldb_di_clock_sources (void ) {struct mxc_ccm_reg *mxc_ccm = (struct mxc_ccm_reg *)CCM_BASE_ADDR ;
Signature · 1 line
2.28.0
PATCH v4 4/9 imx6: allow usage of disable_ldb_di_clock_sources for CONFIG_MX6QDL
Quoted 3 lines
Allow using
disable_ldb_di_clock_sourceswith just the combinedCONFIG_MX6QDLbeing enabled.Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 5/9 sysreset: Add poweroff-gpio driver
In reply to Sebastian ReichelAdd GPIO poweroff driver, which is based on the Linux driver and uses the same DT binding.
--- drivers/sysreset/Kconfig | 7 +++ drivers/sysreset/Makefile | 1 + drivers/sysreset/poweroff_gpio.c | 92 ++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 drivers/sysreset/poweroff_gpio.c
drivers/sysreset/Kconfig +7 -0
@@ -43,6 +43,13 @@ config SYSRESET_CMD_POWEROFF endif +config POWEROFF_GPIO + bool "Enable support for GPIO poweroff driver" + select DM_GPIO + help + Support for system poweroff using a GPIO pin. This can be used + for systems having a single GPIO to trigger a system poweroff. + config SYSRESET_GPIO bool "Enable support for GPIO reset driver" select DM_GPIO
drivers/sysreset/Makefile +1 -0
@@ -7,6 +7,7 @@ obj-$(CONFIG_ARCH_ASPEED) += sysreset_ast.o obj-$(CONFIG_ARCH_ROCKCHIP) += sysreset_rockchip.o obj-$(CONFIG_ARCH_STI) += sysreset_sti.o obj-$(CONFIG_SANDBOX) += sysreset_sandbox.o +obj-$(CONFIG_POWEROFF_GPIO) += poweroff_gpio.o obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o obj-$(CONFIG_SYSRESET_MPC83XX) += sysreset_mpc83xx.o obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
drivers/sysreset/poweroff_gpio.c new file +92 -0
92 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v4 5/9 sysreset: Add poweroff-gpio driver
Quoted 4 lines
Add GPIO poweroff driver, which is based on the Linux driver and uses the same DT binding.
Reviewed-by Simon Glass <[email protected]>Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 6/9 board: ge: common: rename ge_common.c to ge_rtc.c
In reply to Sebastian ReichelThe file only contains RTC related code, so let's name it accordingly.
---
board/ge/bx50v3/bx50v3.c | 2 +-
board/ge/common/Makefile | 2 +-
board/ge/common/{ge_common.c => ge_rtc.c} | 0
board/ge/common/{ge_common.h => ge_rtc.h} | 0
board/ge/mx53ppd/mx53ppd.c | 2 +-
5 files changed, 3 insertions(+), 3 deletions(-)
rename board/ge/common/{ge_common.c => ge_rtc.c} (100%)
rename board/ge/common/{ge_common.h => ge_rtc.h} (100%)board/ge/bx50v3/bx50v3.c +1 -1
@@ -35,7 +35,7 @@#include <version.h> #include <stdlib.h> #include <dm/root.h> -#include "../common/ge_common.h" +#include "../common/ge_rtc.h" #include "../common/vpd_reader.h" #include "../../../drivers/net/e1000.h" #include <pci.h>
board/ge/common/Makefile +1 -1
@@ -2,4 +2,4 @@ # # Copyright 2017 General Electric Company -obj-y := vpd_reader.o ge_common.o +obj-y := vpd_reader.o ge_rtc.o
board/ge/common/ge_rtc.c renamed from board/ge/common/ge_common.c +0 -0
board/ge/common/ge_rtc.h renamed from board/ge/common/ge_common.h +0 -0
board/ge/mx53ppd/mx53ppd.c +1 -1
@@ -36,7 +36,7 @@#include <watchdog.h> #include "ppd_gpio.h" #include <stdlib.h> -#include "../../ge/common/ge_common.h" +#include "../../ge/common/ge_rtc.h" #include "../../ge/common/vpd_reader.h" DECLARE_GLOBAL_DATA_PTR ;
Signature · 1 line
2.28.0
PATCH v4 6/9 board: ge: common: rename ge_common.c to ge_rtc.c
Quoted 3 lines
The file only contains RTC related code, so let's name it accordingly.
Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 7/9 board: ge: common: add config option for RTC and VPD feature
In reply to Sebastian ReichelWhile this code is being used by all GE platforms its useful to have it behind a config option for hardware bringup of new platforms.
--- board/ge/bx50v3/Kconfig | 2 ++ board/ge/common/Kconfig | 7 +++++++ board/ge/common/Makefile | 3 ++- board/ge/mx53ppd/Kconfig | 2 ++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 board/ge/common/Kconfig
board/ge/bx50v3/Kconfig +2 -0
@@ -15,4 +15,6 @@ config SYS_SOC config SYS_CONFIG_NAME default "ge_bx50v3" +source "board/ge/common/Kconfig" + endif
board/ge/common/Kconfig new file +7 -0
@@ -0,0 +1,7 @@ +config GE_VPD + bool "Enable GE VPD Support" + default y + +config GE_RTC + bool "Enable GE RTC Support" + default y
board/ge/common/Makefile +2 -1
@@ -2,4 +2,5 @@ # # Copyright 2017 General Electric Company -obj-y := vpd_reader.o ge_rtc.o +obj-$(CONFIG_GE_VPD) += vpd_reader.o +obj-$(CONFIG_GE_RTC) += ge_rtc.o
board/ge/mx53ppd/Kconfig +2 -0
@@ -13,4 +13,6 @@ config SYS_SOC config SYS_CONFIG_NAME default "mx53ppd" +source "board/ge/common/Kconfig" + endif
Signature · 1 line
2.28.0
PATCH v4 7/9 board: ge: common: add config option for RTC and VPD feature
Quoted 4 lines
While this code is being used by all GE platforms its useful to have it behind a config option for hardware bringup of new platforms.
Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 8/9 board: ge: common: vpd: separate I2C specific code
In reply to Sebastian ReichelThis separates the I2C specific code from the generic GE vital product data code, so that the generic parts can be used on hardware with VPD stored in SPI flash memory.
--- board/ge/bx50v3/bx50v3.c | 2 +- board/ge/common/vpd_reader.c | 12 ++++++------ board/ge/common/vpd_reader.h | 23 +++++++++++++++++++---- board/ge/mx53ppd/mx53ppd.c | 2 +- 4 files changed, 27 insertions(+), 12 deletions(-)
board/ge/bx50v3/bx50v3.c +1 -1
@@ -429,7 +429,7 @@ static void set_confidx(const struct vpd_cache* vpd)int board_init (void ) { -if (!read_vpd (&vpd, vpd_callback)) { +if (!read_i2c_vpd (&vpd, vpd_callback)) {int ret, rescan; vpd.is_read = true;
board/ge/common/vpd_reader.c +6 -6
@@ -110,9 +110,9 @@ static const size_t HEADER_BLOCK_ECC_LEN = 4;static const u8 ECC_BLOCK_ID =0xFF ; -static int vpd_reader (size_t size,u8 *data,struct vpd_cache *userdata, -int (*fn)(struct vpd_cache *,u8 id,u8 version,u8 type, -size_t size,u8 const *data)) +int vpd_reader (size_t size,u8 *data,struct vpd_cache *userdata, +int (*fn)(struct vpd_cache *,u8 id,u8 version,u8 type, +size_t size,u8 const *data)) {if (size <HEADER_BLOCK_LEN || !data || !fn)return -EINVAL ;
@@ -200,9 +200,9 @@ static int vpd_reader(size_t size, u8 *data, struct vpd_cache *userdata, } } -int read_vpd (struct vpd_cache *cache, -int (*process_block)(struct vpd_cache *,u8 id,u8 version, -u8 type,size_t size,u8 const *data)) +int read_i2c_vpd (struct vpd_cache *cache, +int (*process_block)(struct vpd_cache *,u8 id,u8 version, +u8 type,size_t size,u8 const *data)) {struct udevice *dev;int ret;
board/ge/common/vpd_reader.h +19 -4
@@ -16,7 +16,22 @@ struct vpd_cache;* * Returns Non-zero on error. Negative numbers encode errno. */ -int read_vpd (struct vpd_cache *cache, -int (*process_block)(struct vpd_cache *, -u8 id,u8 version,u8 type, -size_t size,u8 const *data)); +int read_i2c_vpd (struct vpd_cache *cache, +int (*process_block)(struct vpd_cache *,u8 id,u8 version, +u8 type,size_t size,u8 const *data)); + +/* +* Read VPD from given data, verify content, call callback for each vital +* product data block. +* +* size: size of the raw VPD data in bytes +* data: raw VPD data read from device +* cache: structure used by process block to store VPD information +* process_block: callback called for each VPD data block +* +* Returns Non-zero on error. Negative numbers encode errno. +*/ + +int vpd_reader (size_t size,u8 *data,struct vpd_cache *cache, +int (*process_block)(struct vpd_cache *,u8 id,u8 version,u8 type, +size_t size,u8 const *data));
board/ge/mx53ppd/mx53ppd.c +1 -1
@@ -225,7 +225,7 @@ int board_late_init(void)struct vpd_cache vpd;memset (&vpd,0 ,sizeof (vpd)); - res =read_vpd (&vpd, vpd_callback); + res =read_i2c_vpd (&vpd, vpd_callback);if (!res)process_vpd (&vpd);else
Signature · 1 line
2.28.0
PATCH v4 8/9 board: ge: common: vpd: separate I2C specific code
Quoted 5 lines
This separates the I2C specific code from the generic GE vital product data code, so that the generic parts can be used on hardware with VPD stored in SPI flash memory.
Signed-off-by Sebastian Reichel <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
PATCH v4 9/9 board: ge: b1x5v2: Add GE B1x5v2 and B1x5Pv2
In reply to Sebastian ReichelGE B1x5v2 patient monitor series is similar to the CARESCAPE Monitor series (GE Bx50). It consists of a carrier PCB used in combination with a Congatec QMX6 SoM. This adds U-Boot support using device model everywhere and SPL for memory initialization.
Proper configuration is provided as 'ge_b1x5v2_defconfig' and the combined image u-boot-with-spi.imx can be flashed directly to 1024 byte offset to /dev/mtdblock0. Alternatively SPL and u-boot.imx can be loaded separately via USB-OTG using e.g. imx_usb.
--- arch/arm/dts/Makefile | 1 + arch/arm/dts/imx6dl-b1x5v2.dts | 654 ++++++++++++++++++++++++++++++ arch/arm/mach-imx/mx6/Kconfig | 9 + board/ge/b1x5v2/Kconfig | 14 + board/ge/b1x5v2/Makefile | 6 + board/ge/b1x5v2/b1x5v2.c | 698 +++++++++++++++++++++++++++++++++ board/ge/b1x5v2/spl.c | 587 +++++++++++++++++++++++++++ configs/ge_b1x5v2_defconfig | 137 +++++++ include/configs/ge_b1x5v2.h | 127 ++++++ 9 files changed, 2233 insertions(+) create mode 100644 arch/arm/dts/imx6dl-b1x5v2.dts create mode 100644 board/ge/b1x5v2/Kconfig create mode 100644 board/ge/b1x5v2/Makefile create mode 100644 board/ge/b1x5v2/b1x5v2.c create mode 100644 board/ge/b1x5v2/spl.c create mode 100644 configs/ge_b1x5v2_defconfig create mode 100644 include/configs/ge_b1x5v2.h
arch/arm/dts/Makefile +1 -0
@@ -975,6 +975,7 @@ dtb-$(CONFIG_TARGET_GE_BX50V3) += \ imx6q-b650v3.dtb \ imx6q-b450v3.dtb +dtb-$(CONFIG_TARGET_GE_B1X5V2) += imx6dl-b1x5v2.dtb dtb-$(CONFIG_TARGET_MX53PPD) += imx53-ppd.dtb dtb-$(CONFIG_TARGET_VEXPRESS_CA5X2) += vexpress-v2p-ca5s.dtb
arch/arm/dts/imx6dl-b1x5v2.dts new file +654 -0
654 lines not on this page · raw message
arch/arm/mach-imx/mx6/Kconfig +9 -0
@@ -253,6 +253,14 @@ config TARGET_GE_BX50V3 depends on MX6Q select BOARD_LATE_INIT +config TARGET_GE_B1X5V2 + bool "General Electric B1x5v2" + depends on MX6QDL + select BOARD_LATE_INIT + select DM + select DM_THERMAL + select SUPPORT_SPL + config TARGET_GW_VENTANA bool "gw_ventana" depends on MX6QDL
@@ -713,6 +721,7 @@ config SYS_SOC default "mx6" source "board/ge/bx50v3/Kconfig" +source "board/ge/b1x5v2/Kconfig" source "board/advantech/dms-ba16/Kconfig" source "board/aristainetos/Kconfig" source "board/armadeus/opos6uldev/Kconfig"
board/ge/b1x5v2/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +if TARGET_GE_B1X5V2 + +config SYS_BOARD + default "b1x5v2" + +config SYS_VENDOR + default "ge" + +config SYS_CONFIG_NAME + default "ge_b1x5v2" + +source "board/ge/common/Kconfig" + +endif
board/ge/b1x5v2/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright 2018-2020 Collabora +# Copyright 2018-2020 GE + +obj-y := b1x5v2.o spl.o
board/ge/b1x5v2/b1x5v2.c new file +698 -0
698 lines not on this page · raw message
board/ge/b1x5v2/spl.c new file +587 -0
587 lines not on this page · raw message
configs/ge_b1x5v2_defconfig new file +137 -0
137 lines not on this page · raw message
include/configs/ge_b1x5v2.h new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
2.28.0
PATCH v4 9/9 board: ge: b1x5v2: Add GE B1x5v2 and B1x5Pv2
Quoted 11 lines · Sebastian Reichel
GE B1x5v2 patient monitor series is similar to the CARESCAPE Monitor series (GE Bx50). It consists of a carrier PCB used in combination with a Congatec QMX6 SoM. This adds U-Boot support using device model everywhere and SPL for memory initialization.
Proper configuration is provided as '
ge_b1x5v2_defconfig' and the combined image u-boot-with-spi.imx can be flashed directly to 1024 byte offset to/dev/mtdblock0. Alternatively SPL and u-boot.imx can be loaded separately via USB-OTG using e.g.imx_usb.Signed-off-by Sebastian Reichel <[email protected]>
As I went checking for a good sized gap between kernel and dtb, and I see it's got I was looking for:
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/20200902/cf6bec7b/attachment.sig>
PATCH v4 9/9 board: ge: b1x5v2: Add GE B1x5v2 and B1x5Pv2
In reply to Sebastian ReichelQuoted 10 lines
GE B1x5v2 patient monitor series is similar to the CARESCAPE Monitor series (GE Bx50). It consists of a carrier PCB used in combination with a Congatec QMX6 SoM. This adds U-Boot support using device model everywhere and SPL for memory initialization.
Proper configuration is provided as 'ge_b1x5v2_defconfig' and the combined image u-boot-with-spi.imx can be flashed directly to 1024 byte offset to/dev/mtdblock0. Alternatively SPL and u-boot.imx can be loaded separately via USB-OTG using e.g.imx_usb.Signed-off-by Sebastian Reichel <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
Fabio Estevam
reviewerv4 cover Introduce B1x5v2 support
In reply to Sebastian ReichelHi Sebastian,
Quoted 11 lines · Sebastian Reichel
This series introduces support for a new i.MX6DL based GE patient monitor series.
Patch 1: Add support for storing bootcount in SPI-flash Patch 2+3: Improve M41T62 RTC driver's reset routine. PATCH 4: Support
disable_ldb_di_clock_sourcesfor i.MX6DL Patch 5: Add poweroff-gpio support
Patch 6-8: restructure common GE code
Patch 9: Add the actual board, using SPL and DM
Quoted 4 lines
Changes since PATCHv3 [0]:
* Dropped patch for reading DR for i.MX GPIOs and set SION pinmux bits in B1x5v2 output GPIOs instead
* Rebased to v2020.10-rc3
Thanks for the respin. This version looks good:
v4 cover Introduce B1x5v2 support
In reply to Sebastian ReichelHi Sebastian,
I integrated the patches but the MAINTAINERS file for B1x5v2 is missing. Can you send a follow-up patch to fix this ? (Or just a V5 for 9/9, your choice).
Regards,
Stefano
Quoted 88 lines · Sebastian Reichel
This series introduces support for a new i.MX6DL based GE patient monitor series.
Patch 1: Add support for storing bootcount in SPI-flash Patch 2+3: Improve M41T62 RTC driver's reset routine. PATCH 4: Support
disable_ldb_di_clock_sourcesfor i.MX6DL Patch 5: Add poweroff-gpio support
Patch 6-8: restructure common GE code
Patch 9: Add the actual board, using SPL and DMChanges since PATCHv3 [0]:
* Dropped patch for reading DR for i.MX GPIOs and set SION pinmux bits in B1x5v2 output GPIOs instead
* Rebased to v2020.10-rc3Changes since PATCHv2:
* PATCH 10: Fixed network phy mode ("rgmii" -> "rgmii-id")
* PATCH 6: Fixed nits reported by Simon Glass and added is Reviewed-by Tag.Changes since PATCHv1:
* Rebased to v2020.10-rc2
* Original patch 1 (support forDM_SPI_FLASHwith non-DM SPL) has been dropped, since a similar patch has been merged in the meantime
* poweroff-gpio support is now added using sysreset uclass instead of introducing a new poweroff uclass
* B1x5v2 patch has been updated to follow recent U-Boot changes and to add USB mass storage support[0] http://patchwork.ozlabs.org/project/uboot/list/?series=196979
-- Sebastian
Sebastian Reichel (9):
bootcount: add a DM SPI flash backing store for bootcount
rtc: m41t62: reset SQW inm41t62_rtc_reset
rtc: m41t62: add oscillator fail bit reset support
imx6: allow usage ofdisable_ldb_di_clock_sourcesforCONFIG_MX6QDL
sysreset: Add poweroff-gpio driver
board: ge: common: renamege_common.ctoge_rtc.c
board: ge: common: add config option for RTC and VPD feature
board: ge: common: vpd: separate I2C specific code
board: ge: b1x5v2: Add GE B1x5v2 and B1x5Pv2arch/arm/dts/Makefile | 1 + arch/arm/dts/imx6dl-b1x5v2.dts | 654 ++++++++++++++++++++ arch/arm/mach-imx/mx6/Kconfig | 9 + arch/arm/mach-imx/mx6/clock.c | 2 +- board/ge/b1x5v2/Kconfig | 14 + board/ge/b1x5v2/Makefile | 6 + board/ge/b1x5v2/b1x5v2.c | 698 ++++++++++++++++++++++ board/ge/b1x5v2/spl.c | 587 ++++++++++++++++++ board/ge/bx50v3/Kconfig | 2 + board/ge/bx50v3/bx50v3.c | 4 +- board/ge/common/Kconfig | 7 + board/ge/common/Makefile | 3 +- board/ge/common/{ge_common.c => ge_rtc.c} | 0 board/ge/common/{ge_common.h => ge_rtc.h} | 0 board/ge/common/vpd_reader.c | 12 +- board/ge/common/vpd_reader.h | 23 +- board/ge/mx53ppd/Kconfig | 2 + board/ge/mx53ppd/mx53ppd.c | 4 +- configs/ge_b1x5v2_defconfig | 137 +++++ drivers/bootcount/Kconfig | 10 + drivers/bootcount/Makefile | 1 + drivers/bootcount/spi-flash.c | 125 ++++ drivers/rtc/m41t62.c | 139 ++++- drivers/sysreset/Kconfig | 7 + drivers/sysreset/Makefile | 1 + drivers/sysreset/poweroff_gpio.c | 92 +++ include/configs/ge_b1x5v2.h | 127 ++++ 27 files changed, 2645 insertions(+), 22 deletions(-)create mode 100644
arch/arm/dts/imx6dl-b1x5v2.dtscreate mode 100644 board/ge/b1x5v2/Kconfig create mode 100644 board/ge/b1x5v2/Makefile create mode 100644board/ge/b1x5v2/b1x5v2.ccreate mode 100644board/ge/b1x5v2/spl.ccreate mode 100644 board/ge/common/Kconfig renameboard/ge/common/{ge_common.c=>ge_rtc.c} (100%) renameboard/ge/common/{ge_common.h=>ge_rtc.h} (100%) create mode 100644 configs/ge_b1x5v2_defconfig create mode 100644drivers/bootcount/spi-flash.ccreate mode 100644drivers/sysreset/poweroff_gpio.ccreate mode 100644include/configs/ge_b1x5v2.h
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================
v4 cover Introduce B1x5v2 support
Hi Sebastian,
Quoted 5 lines · Stefano Babic
Hi Sebastian,
I integrated the patches but the
MAINTAINERSfile for B1x5v2 is missing. Can you send a follow-up patch to fix this ? (Or just a V5 for 9/9, your choice).
Just send a follow-up patch, thanks.
Regards,
Stefano
Quoted 94 lines
Regards,
StefanoQuoted 88 lines · Sebastian Reichel
This series introduces support for a new i.MX6DL based GE patient monitor series.
Patch 1: Add support for storing bootcount in SPI-flash Patch 2+3: Improve M41T62 RTC driver's reset routine. PATCH 4: Support
disable_ldb_di_clock_sourcesfor i.MX6DL Patch 5: Add poweroff-gpio support
Patch 6-8: restructure common GE code
Patch 9: Add the actual board, using SPL and DMChanges since PATCHv3 [0]:
? * Dropped patch for reading DR for i.MX GPIOs and set ??? SION pinmux bits in B1x5v2 output GPIOs instead ? * Rebased to v2020.10-rc3Changes since PATCHv2:
* PATCH 10: Fixed network phy mode ("rgmii" -> "rgmii-id")
* PATCH 6: Fixed nits reported by Simon Glass and added is ?? Reviewed-by Tag.Changes since PATCHv1:
* Rebased to v2020.10-rc2
* Original patch 1 (support forDM_SPI_FLASHwith non-DM SPL) ?? has been dropped, since a similar patch has been merged ?? in the meantime
* poweroff-gpio support is now added using sysreset uclass ?? instead of introducing a new poweroff uclass
* B1x5v2 patch has been updated to follow recent U-Boot ?? changes and to add USB mass storage support[0] http://patchwork.ozlabs.org/project/uboot/list/?series=196979
-- Sebastian
Sebastian Reichel (9):
?? bootcount: add a DM SPI flash backing store for bootcount ?? rtc: m41t62: reset SQW inm41t62_rtc_reset
?? rtc: m41t62: add oscillator fail bit reset support
?? imx6: allow usage ofdisable_ldb_di_clock_sourcesforCONFIG_MX6QDL?? sysreset: Add poweroff-gpio driver
?? board: ge: common: renamege_common.ctoge_rtc.c
?? board: ge: common: add config option for RTC and VPD feature ?? board: ge: common: vpd: separate I2C specific code
?? board: ge: b1x5v2: Add GE B1x5v2 and B1x5Pv2? arch/arm/dts/Makefile???????????????????? |?? 1 + ? arch/arm/dts/imx6dl-b1x5v2.dts??????????? | 654 ++++++++++++++++++++ ? arch/arm/mach-imx/mx6/Kconfig???????????? |?? 9 + ? arch/arm/mach-imx/mx6/clock.c???????????? |?? 2 +- ? board/ge/b1x5v2/Kconfig?????????????????? |? 14 + ? board/ge/b1x5v2/Makefile????????????????? |?? 6 + ? board/ge/b1x5v2/b1x5v2.c????????????????? | 698 ++++++++++++++++++++++ ? board/ge/b1x5v2/spl.c???????????????????? | 587 ++++++++++++++++++ ? board/ge/bx50v3/Kconfig?????????????????? |?? 2 + ? board/ge/bx50v3/bx50v3.c????????????????? |?? 4 +- ? board/ge/common/Kconfig?????????????????? |?? 7 + ? board/ge/common/Makefile????????????????? |?? 3 +- ? board/ge/common/{ge_common.c => ge_rtc.c} |?? 0 ? board/ge/common/{ge_common.h => ge_rtc.h} |?? 0 ? board/ge/common/vpd_reader.c????????????? |? 12 +- ? board/ge/common/vpd_reader.h????????????? |? 23 +- ? board/ge/mx53ppd/Kconfig????????????????? |?? 2 + ? board/ge/mx53ppd/mx53ppd.c??????????????? |?? 4 +- ? configs/ge_b1x5v2_defconfig?????????????? | 137 +++++ ? drivers/bootcount/Kconfig???????????????? |? 10 + ? drivers/bootcount/Makefile??????????????? |?? 1 + ? drivers/bootcount/spi-flash.c???????????? | 125 ++++ ? drivers/rtc/m41t62.c????????????????????? | 139 ++++- ? drivers/sysreset/Kconfig????????????????? |?? 7 + ? drivers/sysreset/Makefile???????????????? |?? 1 + ? drivers/sysreset/poweroff_gpio.c????????? |? 92 +++ ? include/configs/ge_b1x5v2.h?????????????? | 127 ++++? 27 files changed, 2645 insertions(+), 22 deletions(-) ? create mode 100644
arch/arm/dts/imx6dl-b1x5v2.dts? create mode 100644 board/ge/b1x5v2/Kconfig
? create mode 100644 board/ge/b1x5v2/Makefile
? create mode 100644board/ge/b1x5v2/b1x5v2.c
? create mode 100644board/ge/b1x5v2/spl.c
? create mode 100644 board/ge/common/Kconfig
? renameboard/ge/common/{ge_common.c=>ge_rtc.c} (100%) ? renameboard/ge/common/{ge_common.h=>ge_rtc.h} (100%) ? create mode 100644 configs/ge_b1x5v2_defconfig ? create mode 100644drivers/bootcount/spi-flash.c? create mode 100644drivers/sysreset/poweroff_gpio.c? create mode 100644include/configs/ge_b1x5v2.h
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================