summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-03-21 10:21:02 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-03-28 10:48:42 +0200
commit0fc7b0047f5501efb7c14b6332adb9e05882ad3f (patch)
treeda50693d35111109ede666e2fbd2615bf3bb545e /arch/arm/boards
parentb19c853fe2416ffc33610c14aafd22ef36755a26 (diff)
downloadbarebox-0fc7b0047f5501efb7c14b6332adb9e05882ad3f.tar.gz
barebox-0fc7b0047f5501efb7c14b6332adb9e05882ad3f.tar.xz
ARM: boards: protonic-imx6: add board specific BBU SD handlers
Add barebox update handler for the SD ports. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220321092103.1357659-1-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards')
-rw-r--r--arch/arm/boards/protonic-imx6/board.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c
index adde1be8d9..5ca80bd306 100644
--- a/arch/arm/boards/protonic-imx6/board.c
+++ b/arch/arm/boards/protonic-imx6/board.c
@@ -74,6 +74,7 @@ struct prt_machine_data {
unsigned int i2c_addr;
unsigned int i2c_adapter;
unsigned int emmc_usdhc;
+ unsigned int sd_usdhc;
unsigned int flags;
int (*init)(struct prt_imx6_priv *priv);
};
@@ -442,6 +443,16 @@ static int prt_imx6_bbu(struct prt_imx6_priv *priv)
if (ret)
goto exit_bbu;
+ devicefile = basprintf("mmc%d", dcfg->sd_usdhc);
+ if (!devicefile) {
+ ret = -ENOMEM;
+ goto exit_bbu;
+ }
+
+ ret = imx6_bbu_internal_mmc_register_handler("SD", devicefile, 0);
+ if (ret)
+ goto exit_bbu;
+
return 0;
exit_bbu:
dev_err(priv->dev, "Failed to register bbu: %pe\n", ERR_PTR(ret));
@@ -850,6 +861,7 @@ static const struct prt_machine_data prt_imx6_cfg_alti6p[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX
@@ -863,6 +875,7 @@ static const struct prt_machine_data prt_imx6_cfg_victgo[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_victgo,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -877,6 +890,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1[] = {
.i2c_addr = 0x50,
.i2c_adapter = 1,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = HW_TYPE_VICUT1,
@@ -884,6 +898,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_kvg_yaco,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -892,6 +907,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_kvg_new,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -906,6 +922,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.i2c_addr = 0x50,
.i2c_adapter = 1,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = HW_TYPE_VICUT1,
@@ -913,6 +930,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_kvg_yaco,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -921,6 +939,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_kvg_yaco,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -929,6 +948,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_kvg_new,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -943,6 +963,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicutp[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_kvg_new,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -957,6 +978,7 @@ static const struct prt_machine_data prt_imx6_cfg_lanmcu[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER,
}, {
.hw_id = UINT_MAX
@@ -970,6 +992,7 @@ static const struct prt_machine_data prt_imx6_cfg_plybas[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR | PRT_IMX6_USB_LONG_DELAY,
}, {
.hw_id = UINT_MAX
@@ -983,6 +1006,7 @@ static const struct prt_machine_data prt_imx6_cfg_plym2m[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR | PRT_IMX6_USB_LONG_DELAY,
}, {
.hw_id = UINT_MAX
@@ -996,6 +1020,7 @@ static const struct prt_machine_data prt_imx6_cfg_prti6g[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 1,
+ .sd_usdhc = 0,
.init = prt_imx6_init_prti6g,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER,
}, {
@@ -1010,6 +1035,7 @@ static const struct prt_machine_data prt_imx6_cfg_prti6q[] = {
.i2c_addr = 0x51,
.i2c_adapter = 2,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = HW_TYPE_PRTI6Q,
@@ -1017,6 +1043,7 @@ static const struct prt_machine_data prt_imx6_cfg_prti6q[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = UINT_MAX
@@ -1030,6 +1057,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtmvt[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = UINT_MAX
@@ -1043,6 +1071,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtrvt[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = UINT_MAX
@@ -1056,6 +1085,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtvt7[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.init = prt_imx6_init_prtvt7,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER |
PRT_IMX6_USB_LONG_DELAY,
@@ -1071,6 +1101,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtwd2[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX
@@ -1084,6 +1115,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtwd3[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 2,
+ .sd_usdhc = 0,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX
@@ -1097,6 +1129,7 @@ static const struct prt_machine_data prt_imx6_cfg_jozacp[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 0,
+ .sd_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER,
}, {
.hw_id = HW_TYPE_JOZACPP,
@@ -1104,6 +1137,7 @@ static const struct prt_machine_data prt_imx6_cfg_jozacp[] = {
.i2c_addr = 0x51,
.i2c_adapter = 0,
.emmc_usdhc = 0,
+ .sd_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER,
}, {
.hw_id = UINT_MAX