boards: frdm_kl25z: add USB support

Add USB support to FRDM_KL25Z board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2018-05-28 18:41:12 +02:00 committed by Kumar Gala
commit 2055b84f79
8 changed files with 44 additions and 0 deletions

View file

@ -64,4 +64,11 @@ config SOC_FLASH_MCUX
endif # FLASH endif # FLASH
if USB
config USB_KINETIS
def_bool y
endif # USB
endif # SOC_MKL25Z endif # SOC_MKL25Z

View file

@ -21,4 +21,10 @@
#define FLASH_DEV_BASE_ADDRESS NXP_KINETIS_FTFA_40020000_BASE_ADDRESS #define FLASH_DEV_BASE_ADDRESS NXP_KINETIS_FTFA_40020000_BASE_ADDRESS
#define FLASH_DEV_NAME NXP_KINETIS_FTFA_40020000_LABEL #define FLASH_DEV_NAME NXP_KINETIS_FTFA_40020000_LABEL
#define CONFIG_USBD_KINETIS_NAME NXP_KINETIS_USBD_40072000_LABEL
#define CONFIG_USBD_KINETIS_IRQ NXP_KINETIS_USBD_40072000_IRQ_USB_OTG
#define CONFIG_USBD_KINETIS_IRQ_PRI NXP_KINETIS_USBD_40072000_IRQ_USB_OTG_PRIORITY
#define CONFIG_USBD_KINETIS_BASE_ADDRESS NXP_KINETIS_USBD_40072000_BASE_ADDRESS
#define CONFIG_USBD_KINETIS_NUM_BIDIR_EP NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -98,6 +98,10 @@ static ALWAYS_INLINE void clkInit(void)
#ifdef CONFIG_UART_MCUX_LPSCI_0 #ifdef CONFIG_UART_MCUX_LPSCI_0
CLOCK_SetLpsci0Clock(LPSCI0SRC_MCGFLLCLK); CLOCK_SetLpsci0Clock(LPSCI0SRC_MCGFLLCLK);
#endif #endif
#if CONFIG_USB_KINETIS
CLOCK_EnableUsbfs0Clock(kCLOCK_UsbSrcPll0,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC);
#endif
} }
static int kl2x_init(struct device *arg) static int kl2x_init(struct device *arg)

View file

@ -17,6 +17,7 @@ extern "C" {
#ifndef _ASMLANGUAGE #ifndef _ASMLANGUAGE
#include <fsl_common.h>
#include <device.h> #include <device.h>
#include <misc/util.h> #include <misc/util.h>
#include <random/rand32.h> #include <random/rand32.h>

View file

@ -61,6 +61,8 @@ The frdm_kl25z board configuration supports the following hardware features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| FLASH | on-chip | soc flash | | FLASH | on-chip | soc flash |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+-------------------------------------+
The default configuration can be found in the defconfig file: The default configuration can be found in the defconfig file:
@ -106,6 +108,13 @@ Serial Port
The KL25Z UART0 is used for the console. The KL25Z UART0 is used for the console.
USB
===
The KL25Z SoC has a USB OTG (USBOTG) controller that supports both
device and host functions through its mini USB connector (USB KL25Z).
Only USB device function is supported in Zephyr at the moment.
Programming and Debugging Programming and Debugging
************************* *************************

View file

@ -70,3 +70,9 @@
status = "ok"; status = "ok";
current-speed = <115200>; current-speed = <115200>;
}; };
&usbd {
compatible = "nxp,kinetis-usbd";
status = "ok";
num-bidir-endpoints = <8>;
};

View file

@ -15,3 +15,4 @@ supported:
- adc - adc
- i2c - i2c
- gpio - gpio
- usb_device

View file

@ -137,6 +137,16 @@
gpio-controller; gpio-controller;
#gpio-cells = <2>; #gpio-cells = <2>;
}; };
usbd: usbd@40072000 {
compatible = "nxp,kinetis-usbd";
reg = <0x40072000 0x1000>;
interrupts = <24 1>;
interrupt-names = "usb_otg";
num-bidir-endpoints = <16>;
status = "disabled";
label = "USBD";
};
}; };
}; };