diff options
author | David Daney | 2013-12-03 11:46:51 -0800 |
---|---|---|
committer | Ralf Baechle | 2014-01-23 13:02:35 +0100 |
commit | d617f9e9b80632e5206f0a88b7b25ef39bd2612b (patch) | |
tree | 404e8004b810eeec04861136971c7ae9c57ba530 /arch/mips/cavium-octeon/executive | |
parent | 23a91de41cd996f927efa2ca0805e882426eefb4 (diff) |
MIPS: OCTEON: Supply OCTEON+ USB nodes in internal device trees.
This will be needed by the next patch to use said nodes for probing
via the device tree.
Signed-off-by: David Daney <david.daney@cavium.com>
Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: John Crispin <blogic@openwrt.org>
Patchwork: http://patchwork.linux-mips.org/patch/6185/
Diffstat (limited to 'arch/mips/cavium-octeon/executive')
-rw-r--r-- | arch/mips/cavium-octeon/executive/cvmx-helper-board.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c index 0a1283ce47f5..b764df64be40 100644 --- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c +++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c @@ -722,3 +722,30 @@ int __cvmx_helper_board_hardware_enable(int interface) } return 0; } + +/** + * Get the clock type used for the USB block based on board type. + * Used by the USB code for auto configuration of clock type. + * + * Return USB clock type enumeration + */ +enum cvmx_helper_board_usb_clock_types __cvmx_helper_board_usb_get_clock_type(void) +{ + switch (cvmx_sysinfo_get()->board_type) { + case CVMX_BOARD_TYPE_BBGW_REF: + case CVMX_BOARD_TYPE_LANAI2_A: + case CVMX_BOARD_TYPE_LANAI2_U: + case CVMX_BOARD_TYPE_LANAI2_G: + case CVMX_BOARD_TYPE_NIC10E_66: + case CVMX_BOARD_TYPE_UBNT_E100: + return USB_CLOCK_TYPE_CRYSTAL_12; + case CVMX_BOARD_TYPE_NIC10E: + return USB_CLOCK_TYPE_REF_12; + default: + break; + } + /* Most boards except NIC10e use a 12MHz crystal */ + if (OCTEON_IS_MODEL(OCTEON_FAM_2)) + return USB_CLOCK_TYPE_CRYSTAL_12; + return USB_CLOCK_TYPE_REF_48; +} |