pinctrl: uniphier: avoid building unneeded pin-mux tables for SPL

SPL does not use all of the devices, so we can save some memory
footprint.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
Masahiro Yamada 2016-06-29 19:39:00 +09:00
parent 5e25b9d5d9
commit 64c1cc4cc5
10 changed files with 192 additions and 171 deletions

View file

@ -14,6 +14,8 @@
#include "pinctrl-uniphier.h" #include "pinctrl-uniphier.h"
static const char *uniphier_pinctrl_dummy_name = "_dummy";
static int uniphier_pinctrl_get_groups_count(struct udevice *dev) static int uniphier_pinctrl_get_groups_count(struct udevice *dev)
{ {
struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); struct uniphier_pinctrl_priv *priv = dev_get_priv(dev);
@ -26,6 +28,9 @@ static const char *uniphier_pinctrl_get_group_name(struct udevice *dev,
{ {
struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); struct uniphier_pinctrl_priv *priv = dev_get_priv(dev);
if (!priv->socdata->groups[selector].name)
return uniphier_pinctrl_dummy_name;
return priv->socdata->groups[selector].name; return priv->socdata->groups[selector].name;
} }
@ -41,6 +46,9 @@ static const char *uniphier_pinmux_get_function_name(struct udevice *dev,
{ {
struct uniphier_pinctrl_priv *priv = dev_get_priv(dev); struct uniphier_pinctrl_priv *priv = dev_get_priv(dev);
if (!priv->socdata->functions[selector])
return uniphier_pinctrl_dummy_name;
return priv->socdata->functions[selector]; return priv->socdata->functions[selector];
} }

View file

@ -48,29 +48,29 @@ static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
UNIPHIER_PINCTRL_GROUP(i2c3), UNIPHIER_PINCTRL_GROUP(i2c3),
UNIPHIER_PINCTRL_GROUP(i2c4), UNIPHIER_PINCTRL_GROUP(i2c4),
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
}; };
static const char * const uniphier_ld11_functions[] = { static const char * const uniphier_ld11_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"i2c4", UNIPHIER_PINMUX_FUNCTION(i2c4),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
}; };
static struct uniphier_pinctrl_socdata uniphier_ld11_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_ld11_pinctrl_socdata = {

View file

@ -53,10 +53,10 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
UNIPHIER_PINCTRL_GROUP(i2c4), UNIPHIER_PINCTRL_GROUP(i2c4),
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
@ -64,21 +64,21 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
}; };
static const char * const uniphier_ld20_functions[] = { static const char * const uniphier_ld20_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"i2c4", UNIPHIER_PINMUX_FUNCTION(i2c4),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
"usb3", UNIPHIER_PINMUX_FUNCTION(usb3),
}; };
static struct uniphier_pinctrl_socdata uniphier_ld20_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_ld20_pinctrl_socdata = {

View file

@ -62,8 +62,8 @@ static const unsigned usb2b_pins[] = {67, 68};
static const int usb2b_muxvals[] = {23, 23}; static const int usb2b_muxvals[] = {23, 23};
static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = { static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
UNIPHIER_PINCTRL_GROUP(emmc), UNIPHIER_PINCTRL_GROUP_SPL(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8), UNIPHIER_PINCTRL_GROUP_SPL(emmc_dat8),
UNIPHIER_PINCTRL_GROUP(i2c0), UNIPHIER_PINCTRL_GROUP(i2c0),
UNIPHIER_PINCTRL_GROUP(i2c1), UNIPHIER_PINCTRL_GROUP(i2c1),
UNIPHIER_PINCTRL_GROUP(i2c2), UNIPHIER_PINCTRL_GROUP(i2c2),
@ -71,11 +71,11 @@ static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(nand_cs1), UNIPHIER_PINCTRL_GROUP(nand_cs1),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart1b), UNIPHIER_PINCTRL_GROUP_SPL(uart1b),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
@ -83,20 +83,20 @@ static const struct uniphier_pinctrl_group uniphier_ld4_groups[] = {
}; };
static const char * const uniphier_ld4_functions[] = { static const char * const uniphier_ld4_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION_SPL(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c2", UNIPHIER_PINMUX_FUNCTION(i2c2),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
}; };
static struct uniphier_pinctrl_socdata uniphier_ld4_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_ld4_pinctrl_socdata = {

View file

@ -61,8 +61,8 @@ static const unsigned usb3_pins[] = {62, 63};
static const int usb3_muxvals[] = {0, 0}; static const int usb3_muxvals[] = {0, 0};
static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = { static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
UNIPHIER_PINCTRL_GROUP(emmc), UNIPHIER_PINCTRL_GROUP_SPL(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8), UNIPHIER_PINCTRL_GROUP_SPL(emmc_dat8),
UNIPHIER_PINCTRL_GROUP(i2c0), UNIPHIER_PINCTRL_GROUP(i2c0),
UNIPHIER_PINCTRL_GROUP(i2c1), UNIPHIER_PINCTRL_GROUP(i2c1),
UNIPHIER_PINCTRL_GROUP(i2c2), UNIPHIER_PINCTRL_GROUP(i2c2),
@ -70,12 +70,12 @@ static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(nand_cs1), UNIPHIER_PINCTRL_GROUP(nand_cs1),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart0b), UNIPHIER_PINCTRL_GROUP_SPL(uart0b),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart1b), UNIPHIER_PINCTRL_GROUP_SPL(uart1b),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart2b), UNIPHIER_PINCTRL_GROUP_SPL(uart2b),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
@ -83,20 +83,20 @@ static const struct uniphier_pinctrl_group uniphier_ld6b_groups[] = {
}; };
static const char * const uniphier_ld6b_functions[] = { static const char * const uniphier_ld6b_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION_SPL(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c2", UNIPHIER_PINMUX_FUNCTION(i2c2),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
"usb3", UNIPHIER_PINMUX_FUNCTION(usb3),
}; };
static struct uniphier_pinctrl_socdata uniphier_ld6b_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_ld6b_pinctrl_socdata = {

View file

@ -54,8 +54,8 @@ static const unsigned usb3_pins[] = {186, 187};
static const int usb3_muxvals[] = {0, 0}; static const int usb3_muxvals[] = {0, 0};
static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = { static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
UNIPHIER_PINCTRL_GROUP(emmc), UNIPHIER_PINCTRL_GROUP_SPL(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8), UNIPHIER_PINCTRL_GROUP_SPL(emmc_dat8),
UNIPHIER_PINCTRL_GROUP(i2c0), UNIPHIER_PINCTRL_GROUP(i2c0),
UNIPHIER_PINCTRL_GROUP(i2c1), UNIPHIER_PINCTRL_GROUP(i2c1),
UNIPHIER_PINCTRL_GROUP(i2c2), UNIPHIER_PINCTRL_GROUP(i2c2),
@ -65,10 +65,10 @@ static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
UNIPHIER_PINCTRL_GROUP(nand_cs1), UNIPHIER_PINCTRL_GROUP(nand_cs1),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(sd1), UNIPHIER_PINCTRL_GROUP(sd1),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
@ -76,23 +76,23 @@ static const struct uniphier_pinctrl_group uniphier_pro4_groups[] = {
}; };
static const char * const uniphier_pro4_functions[] = { static const char * const uniphier_pro4_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION_SPL(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c2", UNIPHIER_PINMUX_FUNCTION(i2c2),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"i2c6", UNIPHIER_PINMUX_FUNCTION(i2c6),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"sd1", UNIPHIER_PINMUX_FUNCTION(sd1),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
"usb3", UNIPHIER_PINMUX_FUNCTION(usb3),
}; };
static struct uniphier_pinctrl_socdata uniphier_pro4_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_pro4_pinctrl_socdata = {

View file

@ -67,8 +67,8 @@ static const unsigned usb2_pins[] = {128, 129};
static const int usb2_muxvals[] = {0, 0}; static const int usb2_muxvals[] = {0, 0};
static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = { static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
UNIPHIER_PINCTRL_GROUP(emmc), UNIPHIER_PINCTRL_GROUP_SPL(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8), UNIPHIER_PINCTRL_GROUP_SPL(emmc_dat8),
UNIPHIER_PINCTRL_GROUP(i2c0), UNIPHIER_PINCTRL_GROUP(i2c0),
UNIPHIER_PINCTRL_GROUP(i2c1), UNIPHIER_PINCTRL_GROUP(i2c1),
UNIPHIER_PINCTRL_GROUP(i2c2), UNIPHIER_PINCTRL_GROUP(i2c2),
@ -80,33 +80,33 @@ static const struct uniphier_pinctrl_group uniphier_pro5_groups[] = {
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(nand_cs1), UNIPHIER_PINCTRL_GROUP(nand_cs1),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart0b), UNIPHIER_PINCTRL_GROUP_SPL(uart0b),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
}; };
static const char * const uniphier_pro5_functions[] = { static const char * const uniphier_pro5_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION_SPL(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c2", UNIPHIER_PINMUX_FUNCTION(i2c2),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"i2c5", UNIPHIER_PINMUX_FUNCTION(i2c5),
"i2c6", UNIPHIER_PINMUX_FUNCTION(i2c6),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
}; };
static struct uniphier_pinctrl_socdata uniphier_pro5_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_pro5_pinctrl_socdata = {

View file

@ -61,8 +61,8 @@ static const unsigned usb3_pins[] = {62, 63};
static const int usb3_muxvals[] = {8, 8}; static const int usb3_muxvals[] = {8, 8};
static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = { static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
UNIPHIER_PINCTRL_GROUP(emmc), UNIPHIER_PINCTRL_GROUP_SPL(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8), UNIPHIER_PINCTRL_GROUP_SPL(emmc_dat8),
UNIPHIER_PINCTRL_GROUP(i2c0), UNIPHIER_PINCTRL_GROUP(i2c0),
UNIPHIER_PINCTRL_GROUP(i2c1), UNIPHIER_PINCTRL_GROUP(i2c1),
UNIPHIER_PINCTRL_GROUP(i2c2), UNIPHIER_PINCTRL_GROUP(i2c2),
@ -72,12 +72,12 @@ static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(nand_cs1), UNIPHIER_PINCTRL_GROUP(nand_cs1),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart0b), UNIPHIER_PINCTRL_GROUP_SPL(uart0b),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(uart3b), UNIPHIER_PINCTRL_GROUP_SPL(uart3b),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
@ -85,23 +85,23 @@ static const struct uniphier_pinctrl_group uniphier_pxs2_groups[] = {
}; };
static const char * const uniphier_pxs2_functions[] = { static const char * const uniphier_pxs2_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION_SPL(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c2", UNIPHIER_PINMUX_FUNCTION(i2c2),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"i2c5", UNIPHIER_PINMUX_FUNCTION(i2c5),
"i2c6", UNIPHIER_PINMUX_FUNCTION(i2c6),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
"usb3", UNIPHIER_PINMUX_FUNCTION(usb3),
}; };
static struct uniphier_pinctrl_socdata uniphier_pxs2_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_pxs2_pinctrl_socdata = {

View file

@ -72,8 +72,8 @@ static const unsigned usb2_pins[] = {114, 115};
static const int usb2_muxvals[] = {1, 1}; static const int usb2_muxvals[] = {1, 1};
static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = { static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = {
UNIPHIER_PINCTRL_GROUP(emmc), UNIPHIER_PINCTRL_GROUP_SPL(emmc),
UNIPHIER_PINCTRL_GROUP(emmc_dat8), UNIPHIER_PINCTRL_GROUP_SPL(emmc_dat8),
UNIPHIER_PINCTRL_GROUP(i2c0), UNIPHIER_PINCTRL_GROUP(i2c0),
UNIPHIER_PINCTRL_GROUP(i2c1), UNIPHIER_PINCTRL_GROUP(i2c1),
UNIPHIER_PINCTRL_GROUP(i2c2), UNIPHIER_PINCTRL_GROUP(i2c2),
@ -81,30 +81,30 @@ static const struct uniphier_pinctrl_group uniphier_sld8_groups[] = {
UNIPHIER_PINCTRL_GROUP(nand), UNIPHIER_PINCTRL_GROUP(nand),
UNIPHIER_PINCTRL_GROUP(nand_cs1), UNIPHIER_PINCTRL_GROUP(nand_cs1),
UNIPHIER_PINCTRL_GROUP(sd), UNIPHIER_PINCTRL_GROUP(sd),
UNIPHIER_PINCTRL_GROUP(uart0), UNIPHIER_PINCTRL_GROUP_SPL(uart0),
UNIPHIER_PINCTRL_GROUP(uart1), UNIPHIER_PINCTRL_GROUP_SPL(uart1),
UNIPHIER_PINCTRL_GROUP(uart2), UNIPHIER_PINCTRL_GROUP_SPL(uart2),
UNIPHIER_PINCTRL_GROUP(uart3), UNIPHIER_PINCTRL_GROUP_SPL(uart3),
UNIPHIER_PINCTRL_GROUP(usb0), UNIPHIER_PINCTRL_GROUP(usb0),
UNIPHIER_PINCTRL_GROUP(usb1), UNIPHIER_PINCTRL_GROUP(usb1),
UNIPHIER_PINCTRL_GROUP(usb2), UNIPHIER_PINCTRL_GROUP(usb2),
}; };
static const char * const uniphier_sld8_functions[] = { static const char * const uniphier_sld8_functions[] = {
"emmc", UNIPHIER_PINMUX_FUNCTION_SPL(emmc),
"i2c0", UNIPHIER_PINMUX_FUNCTION(i2c0),
"i2c1", UNIPHIER_PINMUX_FUNCTION(i2c1),
"i2c2", UNIPHIER_PINMUX_FUNCTION(i2c2),
"i2c3", UNIPHIER_PINMUX_FUNCTION(i2c3),
"nand", UNIPHIER_PINMUX_FUNCTION(nand),
"sd", UNIPHIER_PINMUX_FUNCTION(sd),
"uart0", UNIPHIER_PINMUX_FUNCTION_SPL(uart0),
"uart1", UNIPHIER_PINMUX_FUNCTION_SPL(uart1),
"uart2", UNIPHIER_PINMUX_FUNCTION_SPL(uart2),
"uart3", UNIPHIER_PINMUX_FUNCTION_SPL(uart3),
"usb0", UNIPHIER_PINMUX_FUNCTION(usb0),
"usb1", UNIPHIER_PINMUX_FUNCTION(usb1),
"usb2", UNIPHIER_PINMUX_FUNCTION(usb2),
}; };
static struct uniphier_pinctrl_socdata uniphier_sld8_pinctrl_socdata = { static struct uniphier_pinctrl_socdata uniphier_sld8_pinctrl_socdata = {

View file

@ -80,7 +80,7 @@ struct uniphier_pinctrl_socdata {
.data = UNIPHIER_PIN_ATTR_PACKED(b), \ .data = UNIPHIER_PIN_ATTR_PACKED(b), \
} }
#define UNIPHIER_PINCTRL_GROUP(grp) \ #define __UNIPHIER_PINCTRL_GROUP(grp) \
{ \ { \
.name = #grp, \ .name = #grp, \
.pins = grp##_pins, \ .pins = grp##_pins, \
@ -90,6 +90,19 @@ struct uniphier_pinctrl_socdata {
ARRAY_SIZE(grp##_muxvals)), \ ARRAY_SIZE(grp##_muxvals)), \
} }
#define __UNIPHIER_PINMUX_FUNCTION(func) #func
#ifdef CONFIG_SPL_BUILD
#define UNIPHIER_PINCTRL_GROUP(grp) { .name = NULL }
#define UNIPHIER_PINMUX_FUNCTION(func) NULL
#else
#define UNIPHIER_PINCTRL_GROUP(grp) __UNIPHIER_PINCTRL_GROUP(grp)
#define UNIPHIER_PINMUX_FUNCTION(func) __UNIPHIER_PINMUX_FUNCTION(func)
#endif
#define UNIPHIER_PINCTRL_GROUP_SPL(grp) __UNIPHIER_PINCTRL_GROUP(grp)
#define UNIPHIER_PINMUX_FUNCTION_SPL(func) __UNIPHIER_PINMUX_FUNCTION(func)
/** /**
* struct uniphier_pinctrl_priv - private data for UniPhier pinctrl driver * struct uniphier_pinctrl_priv - private data for UniPhier pinctrl driver
* *