Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NXP: LPC: various cleanups #24368

Merged
merged 8 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions boards/arm/lpcxpresso54114/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)
device_get_binding(CONFIG_PINMUX_MCUX_LPC_PORT1_NAME);
#endif

#ifdef CONFIG_UART_MCUX_FLEXCOMM_0
#if DT_HAS_NODE(DT_NODELABEL(flexcomm0)) && \
DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm0), nxp_lpc_usart)
/* USART0 RX, TX */
const u32_t port0_pin0_config = (
IOCON_PIO_FUNC1 |
Expand All @@ -50,7 +51,7 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)

#endif

#ifdef CONFIG_GPIO_MCUX_LPC_PORT0
#if DT_HAS_NODE(DT_NODELABEL(gpio0))
const u32_t port0_pin29_config = (
IOCON_PIO_FUNC0 |
IOCON_PIO_MODE_PULLUP |
Expand Down Expand Up @@ -93,7 +94,7 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)

#endif

#ifdef CONFIG_GPIO_MCUX_LPC_PORT1
#if DT_HAS_NODE(DT_NODELABEL(gpio1))
const u32_t port1_pin10_config = (
IOCON_PIO_FUNC0 |
IOCON_PIO_MODE_PULLUP |
Expand All @@ -107,7 +108,8 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)
pinmux_pin_set(port1, 10, port1_pin10_config);
#endif

#ifdef CONFIG_I2C_4
#if DT_HAS_NODE(DT_NODELABEL(flexcomm4)) && \
DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm4), nxp_lpc_i2c)
/* PORT0 PIN25 is configured as FC4_RTS_SCL_SSEL1 */
pinmux_pin_set(port0, 25, IOCON_PIO_FUNC1 |
IOCON_PIO_I2CSLEW_I2C |
Expand All @@ -125,9 +127,10 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)
IOCON_PIO_INPFILT_OFF |
IOCON_PIO_I2CDRIVE_LOW |
IOCON_PIO_I2CFILTER_EN);
#endif /* CONFIG_I2C_4 */
#endif

#ifdef CONFIG_SPI_5
#if DT_HAS_NODE(DT_NODELABEL(flexcomm5)) && \
DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm5), nxp_lpc_spi)
/* PORT0 PIN18 is configured as FC5_TXD_SCL_MISO */
pinmux_pin_set(port0, 18, IOCON_PIO_FUNC1 |
IOCON_PIO_MODE_PULLUP |
Expand Down Expand Up @@ -159,7 +162,7 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_OPENDRAIN_DI);
#endif /* CONFIG_SPI_5 */
#endif

return 0;
}
Expand Down
7 changes: 2 additions & 5 deletions boards/arm/lpcxpresso55s69/lpcxpresso55s69.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
led0 = &red_led;
led1 = &green_led;
led2 = &blue_led;
spi-8 = &flexcomm8;
spi-8 = &hs_lspi;
usart-0 = &flexcomm0;
};

Expand Down Expand Up @@ -52,8 +52,5 @@ arduino_i2c: &flexcomm4 {
};
};

arduino_spi: &flexcomm8 {
compatible = "nxp,lpc-spi";
#address-cells = <1>;
#size-cells = <0>;
arduino_spi: &hs_lspi {
};
2 changes: 1 addition & 1 deletion boards/arm/lpcxpresso55s69/lpcxpresso55s69_cpu0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
status = "okay";
};

&flexcomm8 {
&hs_lspi {
status = "okay";
};

Expand Down
6 changes: 5 additions & 1 deletion boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.dts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
status = "okay";
};

&flexcomm8 {
&flexcomm4 {
status = "okay";
};

&hs_lspi {
status = "okay";
};
2 changes: 1 addition & 1 deletion boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0
#

identifier: lpcxpresso55s69_cpu0
identifier: lpcxpresso55s69_ns
name: NXP LPCXpresso55S69
type: mcu
arch: arm
Expand Down
2 changes: 0 additions & 2 deletions boards/arm/lpcxpresso55s69/lpcxpresso55s69_ns_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# SPDX-License-Identifier: Apache-2.0
#

CONFIG_ARM=y
CONFIG_SOC_SERIES_LPC55XXX=y
CONFIG_BOARD_LPCXPRESSO55S69_CPU0=y
CONFIG_CONSOLE=y
Expand All @@ -16,7 +15,6 @@ CONFIG_GPIO=y
CONFIG_PINMUX=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=96000000
CONFIG_ARM_MPU=y
CONFIG_USERSPACE=y

# Enable TrustZone-M
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
Expand Down
12 changes: 7 additions & 5 deletions boards/arm/lpcxpresso55s69/pinmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev)
device_get_binding(CONFIG_PINMUX_MCUX_LPC_PORT1_NAME);
#endif

#ifdef CONFIG_UART_MCUX_FLEXCOMM_0
#if DT_HAS_NODE(DT_NODELABEL(flexcomm0)) && \
DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm0), nxp_lpc_usart)
/* USART0 RX, TX */
const u32_t port0_pin29_config = (
IOCON_PIO_FUNC1 |
Expand Down Expand Up @@ -87,7 +88,8 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev)
pinmux_pin_set(port1, DT_ALIAS_SW2_GPIOS_PIN, sw2_config);
#endif

#ifdef CONFIG_I2C_4
#if DT_HAS_NODE(DT_NODELABEL(flexcomm4)) && \
DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm4), nxp_lpc_i2c)
/* PORT1 PIN20 is configured as FC4_TXD_SCL_MISO_WS */
pinmux_pin_set(port1, 20, IOCON_PIO_FUNC5 |
IOCON_PIO_MODE_INACT |
Expand All @@ -103,7 +105,7 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev)
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_OPENDRAIN_DI);
#endif /* CONFIG_I2C_4 */
#endif

#ifdef CONFIG_FXOS8700_TRIGGER
pinmux_pin_set(port1, 19, IOCON_PIO_FUNC0 |
Expand All @@ -115,7 +117,7 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev)
IOCON_PIO_OPENDRAIN_DI);
#endif

#ifdef CONFIG_SPI_8
#if DT_HAS_NODE(DT_NODELABEL(hs_lspi))
/* PORT0 PIN26 is configured as HS_SPI_MOSI */
pinmux_pin_set(port0, 26, IOCON_PIO_FUNC9 |
IOCON_PIO_MODE_PULLUP |
Expand Down Expand Up @@ -147,7 +149,7 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev)
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_OPENDRAIN_DI);
#endif /* CONFIG_SPI_8 */
#endif

return 0;
}
Expand Down
10 changes: 0 additions & 10 deletions drivers/gpio/Kconfig.mcux_lpc
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,10 @@ config GPIO_MCUX_LPC_PORT0
help
Enable Port 0.

config GPIO_MCUX_LPC_PORT0_NAME
string "Port 0 driver name"
depends on GPIO_MCUX_LPC_PORT0
default "GPIO_0"

config GPIO_MCUX_LPC_PORT1
bool "Port 1"
depends on PINMUX_MCUX_LPC_PORT1
help
Enable Port 1.

config GPIO_MCUX_LPC_PORT1_NAME
string "Port 1 driver name"
depends on GPIO_MCUX_LPC_PORT1
default "GPIO_1"

endif # GPIO_MCUX_LPC
35 changes: 17 additions & 18 deletions dts/arm/nxp/nxp_lpc54xxx.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,26 @@
};
};

sram0:memory@20000000 {
compatible = "mmio-sram";
reg = <0x20000000 0x10000>;
};

sram1:memory@20010000 {
compatible = "mmio-sram";
reg = <0x20010000 0x10000>;
};
soc {
sram0:memory@20000000 {
compatible = "mmio-sram";
reg = <0x20000000 0x10000>;
};

sram2:memory@20020000 {
compatible = "mmio-sram";
reg = <0x20020000 0x8000>;
};
sram1:memory@20010000 {
compatible = "mmio-sram";
reg = <0x20010000 0x10000>;
};

sramx:memory@40000000{
compatible = "mmio-sram";
reg = <0x40000000 0x8000>;
};
sram2:memory@20020000 {
compatible = "mmio-sram";
reg = <0x20020000 0x8000>;
};

soc {
sramx:memory@40000000{
compatible = "mmio-sram";
reg = <0x40000000 0x8000>;
};

flash0:flash@0 {
compatible = "soc-nv-flash";
Expand Down
Loading