ARM: DT: stm32f7: add pin control node for serial port pins
And remove the uart pin configuration from board initialization. Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
This commit is contained in:
parent
da4e17f24c
commit
e34e19feb7
3 changed files with 20 additions and 24 deletions
|
@ -70,6 +70,12 @@
|
||||||
clock-frequency = <25000000>;
|
clock-frequency = <25000000>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
&usart1 {
|
||||||
|
pinctrl-0 = <&usart1_pins_a>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
&mac {
|
&mac {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
phy-mode = "rmii";
|
phy-mode = "rmii";
|
||||||
|
|
|
@ -104,6 +104,19 @@
|
||||||
ranges = <0 0x40020000 0x3000>;
|
ranges = <0 0x40020000 0x3000>;
|
||||||
u-boot,dm-pre-reloc;
|
u-boot,dm-pre-reloc;
|
||||||
pins-are-numbered;
|
pins-are-numbered;
|
||||||
|
|
||||||
|
usart1_pins_a: usart1@0 {
|
||||||
|
pins1 {
|
||||||
|
pinmux = <STM32F746_PA9_FUNC_USART1_TX>;
|
||||||
|
bias-disable;
|
||||||
|
drive-push-pull;
|
||||||
|
slew-rate = <2>;
|
||||||
|
};
|
||||||
|
pins2 {
|
||||||
|
pinmux = <STM32F746_PB7_FUNC_USART1_RX>;
|
||||||
|
bias-disable;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,14 +27,6 @@ const struct stm32_gpio_ctl gpio_ctl_gpout = {
|
||||||
.af = STM32_GPIO_AF0
|
.af = STM32_GPIO_AF0
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct stm32_gpio_ctl gpio_ctl_usart = {
|
|
||||||
.mode = STM32_GPIO_MODE_AF,
|
|
||||||
.otype = STM32_GPIO_OTYPE_PP,
|
|
||||||
.speed = STM32_GPIO_SPEED_50M,
|
|
||||||
.pupd = STM32_GPIO_PUPD_UP,
|
|
||||||
.af = STM32_GPIO_AF7
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct stm32_gpio_ctl gpio_ctl_fmc = {
|
const struct stm32_gpio_ctl gpio_ctl_fmc = {
|
||||||
.mode = STM32_GPIO_MODE_AF,
|
.mode = STM32_GPIO_MODE_AF,
|
||||||
.otype = STM32_GPIO_OTYPE_PP,
|
.otype = STM32_GPIO_OTYPE_PP,
|
||||||
|
@ -245,26 +237,11 @@ int dram_init(void)
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct stm32_gpio_dsc usart_gpio[] = {
|
|
||||||
{STM32_GPIO_PORT_A, STM32_GPIO_PIN_9}, /* TX */
|
|
||||||
{STM32_GPIO_PORT_B, STM32_GPIO_PIN_7}, /* RX */
|
|
||||||
};
|
|
||||||
|
|
||||||
int uart_setup_gpio(void)
|
int uart_setup_gpio(void)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
int rv = 0;
|
|
||||||
|
|
||||||
clock_setup(GPIO_A_CLOCK_CFG);
|
clock_setup(GPIO_A_CLOCK_CFG);
|
||||||
clock_setup(GPIO_B_CLOCK_CFG);
|
clock_setup(GPIO_B_CLOCK_CFG);
|
||||||
for (i = 0; i < ARRAY_SIZE(usart_gpio); i++) {
|
return 0;
|
||||||
rv = stm32_gpio_config(&usart_gpio[i], &gpio_ctl_usart);
|
|
||||||
if (rv)
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ETH_DESIGNWARE
|
#ifdef CONFIG_ETH_DESIGNWARE
|
||||||
|
|
Loading…
Reference in a new issue