summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRobin van der Gracht <robin@protonic.nl>2021-08-18 14:19:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-08-23 15:45:20 +0200
commitb7742e1f6944acc7ecba4da0211e976b72c4e809 (patch)
treeb19df05c1819e8f635366b0512e4bb4e73c6dfcb /arch
parent98c8e674962bcec33a69582b34416ee864179b97 (diff)
downloadbarebox-b7742e1f6944acc7ecba4da0211e976b72c4e809.tar.gz
barebox-b7742e1f6944acc7ecba4da0211e976b72c4e809.tar.xz
ARM: boards: protonic-imx6: Add emmc_usdhc machine data variable
The i.MX6 ultralite only has 2 usdhc ports which will be indexed as '0' and '1'. The bbu setup code assumes it is attached as '/dev/mmc2'. Signed-off-by: Robin van der Gracht <robin@protonic.nl> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20210818121945.26089-6-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boards/protonic-imx6/board.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/arch/arm/boards/protonic-imx6/board.c b/arch/arm/boards/protonic-imx6/board.c
index 38630dc2af..0cfafdcc26 100644
--- a/arch/arm/boards/protonic-imx6/board.c
+++ b/arch/arm/boards/protonic-imx6/board.c
@@ -70,6 +70,7 @@ struct prt_machine_data {
unsigned int hw_rev;
unsigned int i2c_addr;
unsigned int i2c_adapter;
+ unsigned int emmc_usdhc;
unsigned int flags;
int (*init)(struct prt_imx6_priv *priv);
};
@@ -411,6 +412,7 @@ static int prt_imx6_bbu(struct prt_imx6_priv *priv)
{
const struct prt_machine_data *dcfg = priv->dcfg;
u32 emmc_flags = 0;
+ char *devicefile;
int ret;
if (dcfg->flags & PRT_IMX6_BOOTSRC_SPI_NOR) {
@@ -422,7 +424,12 @@ static int prt_imx6_bbu(struct prt_imx6_priv *priv)
emmc_flags = BBU_HANDLER_FLAG_DEFAULT;
}
- ret = imx6_bbu_internal_mmcboot_register_handler("eMMC", "/dev/mmc2",
+ devicefile = basprintf("mmc%d", dcfg->emmc_usdhc);
+ if (!devicefile) {
+ ret = -ENOMEM;
+ goto exit_bbu;
+ }
+ ret = imx6_bbu_internal_mmcboot_register_handler("eMMC", devicefile,
emmc_flags);
if (ret)
goto exit_bbu;
@@ -807,6 +814,7 @@ static const struct prt_machine_data prt_imx6_cfg_alti6p[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX
@@ -819,6 +827,7 @@ static const struct prt_machine_data prt_imx6_cfg_victgo[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_victgo,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -832,12 +841,14 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1[] = {
.hw_rev = 0,
.i2c_addr = 0x50,
.i2c_adapter = 1,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = HW_TYPE_VICUT1,
.hw_rev = 1,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_kvg_yaco,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -845,6 +856,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1[] = {
.hw_rev = 1,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_kvg_new,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -858,12 +870,14 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.hw_rev = 0,
.i2c_addr = 0x50,
.i2c_adapter = 1,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = HW_TYPE_VICUT1,
.hw_rev = 1,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_kvg_yaco,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -871,6 +885,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_kvg_yaco,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -878,6 +893,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicut1q[] = {
.hw_rev = 1,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_kvg_new,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -891,6 +907,7 @@ static const struct prt_machine_data prt_imx6_cfg_vicutp[] = {
.hw_rev = 1,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.init = prt_imx6_init_kvg_new,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
@@ -904,6 +921,7 @@ static const struct prt_machine_data prt_imx6_cfg_lanmcu[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER,
}, {
.hw_id = UINT_MAX
@@ -916,6 +934,7 @@ static const struct prt_machine_data prt_imx6_cfg_plybas[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR | PRT_IMX6_USB_LONG_DELAY,
}, {
.hw_id = UINT_MAX
@@ -928,6 +947,7 @@ static const struct prt_machine_data prt_imx6_cfg_plym2m[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR | PRT_IMX6_USB_LONG_DELAY,
}, {
.hw_id = UINT_MAX
@@ -940,6 +960,7 @@ static const struct prt_machine_data prt_imx6_cfg_prti6g[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 1,
.init = prt_imx6_init_prti6g,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
@@ -953,12 +974,14 @@ static const struct prt_machine_data prt_imx6_cfg_prti6q[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 2,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = HW_TYPE_PRTI6Q,
.hw_rev = 1,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = UINT_MAX
@@ -971,6 +994,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtmvt[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = UINT_MAX
@@ -983,6 +1007,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtrvt[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_SPI_NOR,
}, {
.hw_id = UINT_MAX
@@ -995,6 +1020,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtvt7[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC | PRT_IMX6_BOOTCHOOSER,
}, {
.hw_id = UINT_MAX
@@ -1007,6 +1033,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtwd2[] = {
.hw_rev = 0,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX
@@ -1019,6 +1046,7 @@ static const struct prt_machine_data prt_imx6_cfg_prtwd3[] = {
.hw_rev = 2,
.i2c_addr = 0x51,
.i2c_adapter = 0,
+ .emmc_usdhc = 2,
.flags = PRT_IMX6_BOOTSRC_EMMC,
}, {
.hw_id = UINT_MAX