arch: stm32l4: only enable USB OTG on SoCs supporting it

USB OTG is currently enable for the whole STM32L4 family, while only a
few of them actually support it:

- STM32L475, STM32L476 and STM32L496 have an OTG controller
- STM32L432, STM32L433 and STM32L452 have an USB controller
- STM32L431, STM32L451 and STM32L471 do not have any USB controller

Fix that by moving the DT entry from stm32l4.dtsi to stm32l475.dtsi
and by adding a #ifdef #endif around the corresponding DTS fixup
entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
Aurelien Jarno 2018-05-18 22:46:02 +02:00 committed by Kumar Gala
commit dc01b99068
3 changed files with 15 additions and 13 deletions

View file

@ -74,6 +74,7 @@
#define FLASH_DEV_BASE_ADDRESS ST_STM32L4_FLASH_CONTROLLER_40022000_BASE_ADDRESS
#define FLASH_DEV_NAME ST_STM32L4_FLASH_CONTROLLER_40022000_LABEL
#if defined(ST_STM32_OTGFS_50000000_BASE_ADDRESS)
#define CONFIG_USB_BASE_ADDRESS ST_STM32_OTGFS_50000000_BASE_ADDRESS
#define CONFIG_USB_IRQ ST_STM32_OTGFS_50000000_IRQ_OTGFS
#define CONFIG_USB_IRQ_PRI ST_STM32_OTGFS_50000000_IRQ_OTGFS_PRIORITY
@ -81,5 +82,6 @@
#define CONFIG_USB_NUM_IN_ENDPOINTS ST_STM32_OTGFS_50000000_NUM_IN_ENDPOINTS
#define CONFIG_USB_NUM_OUT_ENDPOINTS ST_STM32_OTGFS_50000000_NUM_OUT_ENDPOINTS
#define CONFIG_USB_RAM_SIZE ST_STM32_OTGFS_50000000_RAM_SIZE
#endif
/* End of SoC Level DTS fixup file */

View file

@ -170,19 +170,6 @@
status = "disabled";
label = "SPI_2";
};
usbotg_fs: otgfs@50000000 {
compatible = "st,stm32-otgfs";
reg = <0x50000000 0x40000>;
interrupts = <67 0>;
interrupt-names = "otgfs";
num-bidir-endpoints = <1>;
num-in-endpoints = <5>;
num-out-endpoints = <5>;
ram-size = <1280>;
status = "disabled";
label= "OTGFS";
};
};
};

View file

@ -98,5 +98,18 @@
status = "disabled";
label = "SPI_3";
};
usbotg_fs: otgfs@50000000 {
compatible = "st,stm32-otgfs";
reg = <0x50000000 0x40000>;
interrupts = <67 0>;
interrupt-names = "otgfs";
num-bidir-endpoints = <1>;
num-in-endpoints = <5>;
num-out-endpoints = <5>;
ram-size = <1280>;
status = "disabled";
label= "OTGFS";
};
};
};