summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorSandeep Gopalpet <sandeep.kumar@freescale.com>2010-03-11 15:41:27 +0530
committerScott Sweeny <scott.sweeny@timesys.com>2010-11-10 14:52:24 -0500
commit19794c6221377b44cc649fea0c141313fd60c42a (patch)
tree2b35609fe8c4c5ae53e49631c4e43ef3e763d46b /board
parent1726656405e65bcb045cb4da6cffb789f8282376 (diff)
85xx/p1_p2_rdb: p1020: add muxed usb2 handling
This patch adds the 2nd USB (muxed with eLBC) node depending upon enabling the 'usb2' environment variable via hwconfig i.e. 'setenv hwconfig usb2', so that linux has the 2nd USB controller enabled, which will lead to the disabling of the eLBC (NAND, NOR etc). Also the 2nd USB controller has been left disabled in the u-boot, otherwise any changes in the environment won't be saved. Signed-off-by: Vivek Mahajan <vivek.mahajan@freescale.com>
Diffstat (limited to 'board')
-rw-r--r--board/freescale/p1_p2_rdb/p1_p2_rdb.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/board/freescale/p1_p2_rdb/p1_p2_rdb.c b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
index 2fa30c34de..9b5f0cf053 100644
--- a/board/freescale/p1_p2_rdb/p1_p2_rdb.c
+++ b/board/freescale/p1_p2_rdb/p1_p2_rdb.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Freescale Semiconductor, Inc.
+ * Copyright 2009-2010 Freescale Semiconductor, Inc.
*
* See file CREDITS for list of people who contributed to this
* project.
@@ -21,6 +21,7 @@
*/
#include <common.h>
+#include <hwconfig.h>
#include <command.h>
#include <asm/processor.h>
#include <asm/mmu.h>
@@ -43,6 +44,7 @@ DECLARE_GLOBAL_DATA_PTR;
#define SGMII_PHY_RST_SET 0x00020000
#define PCIE_RST_SET 0x00010000
#define RGMII_PHY_RST_SET 0x02000000
+#define USB2_PORT_OUT_EN 0x01000000
#define USB_RST_CLR 0x04000000
@@ -227,8 +229,11 @@ int board_eth_init(bd_t *bis)
#if defined(CONFIG_OF_BOARD_SETUP)
void ft_board_setup(void *blob, bd_t *bd)
{
+ volatile ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+ volatile ccsr_gpio_t *gpio = (void *)CONFIG_SYS_MPC85xx_GPIO_ADDR;
phys_addr_t base;
phys_size_t size;
+ int agent;
ft_cpu_setup(blob, bd);
@@ -236,6 +241,22 @@ void ft_board_setup(void *blob, bd_t *bd)
size = getenv_bootm_size();
fdt_fixup_memory(blob, (u64)base, (u64)size);
+
+ if (!hwconfig("usb2"))
+ return;
+
+ agent = hwconfig_subarg_cmp("usb2", "dr_mode", "peripheral");
+
+ /*
+ * Add the 2nd usb node and enable it. eLBC will
+ * now be disabled since it is MUXed with USB2
+ */
+
+ fdt_fixup_add_2nd_usb(blob, agent);
+
+ setbits_be32(&gpio->gpdir, USB2_PORT_OUT_EN);
+ setbits_be32(&gpio->gpdat, USB2_PORT_OUT_EN);
+ setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_ELBC_OFF_USB2_ON);
}
#endif