drivers/serial/uart_pl011.c : add the interface about clock and reset control for reducing power consumption.
This commit is contained in:
parent
99dee09146
commit
c93383407b
3 changed files with 32 additions and 0 deletions
|
|
@ -81,4 +81,8 @@ config UART3_CLK_FREQ
|
||||||
|
|
||||||
endif # UART3_PL011
|
endif # UART3_PL011
|
||||||
|
|
||||||
|
config UART_PL011_PLATFORMIF
|
||||||
|
bool "PL011 platform interface"
|
||||||
|
default n
|
||||||
|
|
||||||
endif # UART_PL011
|
endif # UART_PL011
|
||||||
|
|
|
||||||
|
|
@ -903,8 +903,19 @@ static int pl011_attach(FAR struct uart_dev_s *dev)
|
||||||
|
|
||||||
static void pl011_shutdown(FAR struct uart_dev_s *dev)
|
static void pl011_shutdown(FAR struct uart_dev_s *dev)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_UART_PL011_PLATFORMIF
|
||||||
|
struct pl011_uart_port_s *sport = (struct pl011_uart_port_s *)dev->priv;
|
||||||
|
const struct pl011_config *config = &sport->config;
|
||||||
|
|
||||||
|
/* If needed, implement platform specific process such as disabling pl011
|
||||||
|
* to reduce power consumption.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pl011_platform_shutdown((uint32_t)config->uart);
|
||||||
|
#else
|
||||||
UNUSED(dev);
|
UNUSED(dev);
|
||||||
sinfo("%s: call unexpected\n", __func__);
|
sinfo("%s: call unexpected\n", __func__);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static int pl011_setup(FAR struct uart_dev_s *dev)
|
static int pl011_setup(FAR struct uart_dev_s *dev)
|
||||||
|
|
@ -916,6 +927,14 @@ static int pl011_setup(FAR struct uart_dev_s *dev)
|
||||||
uint32_t lcrh;
|
uint32_t lcrh;
|
||||||
irqstate_t i_flags;
|
irqstate_t i_flags;
|
||||||
|
|
||||||
|
#ifdef CONFIG_UART_PL011_PLATFORMIF
|
||||||
|
/* If needed, implement platform specific process such as enabling pl011
|
||||||
|
* to reduce power consumption.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pl011_platform_setup((uint32_t)config->uart);
|
||||||
|
#endif
|
||||||
|
|
||||||
i_flags = up_irq_save();
|
i_flags = up_irq_save();
|
||||||
|
|
||||||
/* If working in SBSA mode, we assume that UART is already configured,
|
/* If working in SBSA mode, we assume that UART is already configured,
|
||||||
|
|
|
||||||
|
|
@ -41,5 +41,14 @@ void pl011_earlyserialinit(void);
|
||||||
|
|
||||||
void pl011_serialinit(void);
|
void pl011_serialinit(void);
|
||||||
|
|
||||||
|
#ifdef CONFIG_UART_PL011_PLATFORMIF
|
||||||
|
/* If needed, implement platform specific process such as enabling pl011
|
||||||
|
* to reduce power consumption.
|
||||||
|
*/
|
||||||
|
|
||||||
|
int pl011_platform_setup(uint32_t base);
|
||||||
|
int pl011_platform_shutdown(uint32_t base);
|
||||||
|
#endif /* CONFIG_UART_PL011_PLATFORMIF */
|
||||||
|
|
||||||
#endif /* CONFIG_UART_PL011 */
|
#endif /* CONFIG_UART_PL011 */
|
||||||
#endif /* __INCLUDE_NUTTX_SERIAL_UART_PL011_H */
|
#endif /* __INCLUDE_NUTTX_SERIAL_UART_PL011_H */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue