MX31: add support for setting pin pads
Subsystems (5)
PATCH 1/3 MX31: add support for setting pin pads
The patch adds a utility function and defines
to set the pad as it is done in linux.
--- arch/arm/cpu/arm1136/mx31/generic.c | 17 ++ arch/arm/include/asm/arch-mx31/mx31-regs.h | 404 ++++++++++++++++++++++++++++ drivers/video/mx3fb.c | 31 --- 3 files changed, 421 insertions(+), 31 deletions(-)
arch/arm/cpu/arm1136/mx31/generic.c +17 -0
@@ -23,6 +23,7 @@#include <common.h> #include <asm/arch/mx31-regs.h> +#include <asm/io.h> static u32 mx31_decode_pll (u32 reg,u32 infreq) {
@@ -90,6 +91,22 @@ void mx31_gpio_mux(unsigned long mode)__REG (reg) = tmp; } +void mx31_set_pad (enum iomux_pins pin,u32 config) +{ +u32 field, l; +void *reg; + + pin &=IOMUX_PADNUM_MASK ; + reg = (IOMUXC_BASE +0x154 ) + (pin +2 ) /3 *4 ; + field = (pin +2 ) %3 ; + + l =__raw_readl (reg); + l &= ~(0x1ff << (field *10 )); + l |= config << (field *10 ); +__raw_writel (l, reg); + +} +#if defined(CONFIG_DISPLAY_CPUINFO )int print_cpuinfo (void ) {
arch/arm/include/asm/arch-mx31/mx31-regs.h +404 -0
426 lines not on this page · raw message
drivers/video/mx3fb.c +0 -31
@@ -334,37 +334,6 @@ enum ipu_panel {#define IOMUX_MODE_L (pin, mode) IOMUX_MODE(((pin) + 0xc) ^ 3, mode) -enum lcd_pin { -MX31_PIN_D3_SPL =IOMUX_PIN (0xff ,19 ), -MX31_PIN_D3_CLS =IOMUX_PIN (0xff ,20 ), -MX31_PIN_D3_REV =IOMUX_PIN (0xff ,21 ), -MX31_PIN_CONTRAST =IOMUX_PIN (0xff ,22 ), -MX31_PIN_VSYNC3 =IOMUX_PIN (0xff ,23 ), - -MX31_PIN_DRDY0 =IOMUX_PIN (0xff ,33 ), -MX31_PIN_FPSHIFT =IOMUX_PIN (0xff ,34 ), -MX31_PIN_HSYNC =IOMUX_PIN (0xff ,35 ), - -MX31_PIN_LD17 =IOMUX_PIN (0xff ,37 ), -MX31_PIN_LD16 =IOMUX_PIN (0xff ,38 ), -MX31_PIN_LD15 =IOMUX_PIN (0xff ,39 ), -MX31_PIN_LD14 =IOMUX_PIN (0xff ,40 ), -MX31_PIN_LD13 =IOMUX_PIN (0xff ,41 ), -MX31_PIN_LD12 =IOMUX_PIN (0xff ,42 ), -MX31_PIN_LD11 =IOMUX_PIN (0xff ,43 ), -MX31_PIN_LD10 =IOMUX_PIN (0xff ,44 ), -MX31_PIN_LD9 =IOMUX_PIN (0xff ,45 ), -MX31_PIN_LD8 =IOMUX_PIN (0xff ,46 ), -MX31_PIN_LD7 =IOMUX_PIN (0xff ,47 ), -MX31_PIN_LD6 =IOMUX_PIN (0xff ,48 ), -MX31_PIN_LD5 =IOMUX_PIN (0xff ,49 ), -MX31_PIN_LD4 =IOMUX_PIN (0xff ,50 ), -MX31_PIN_LD3 =IOMUX_PIN (0xff ,51 ), -MX31_PIN_LD2 =IOMUX_PIN (0xff ,52 ), -MX31_PIN_LD1 =IOMUX_PIN (0xff ,53 ), -MX31_PIN_LD0 =IOMUX_PIN (0xff ,54 ), -}; -struct chan_param_mem_planar {/* Word 0 */ u32 xv:10 ;
Signature · 1 line
1.6.3.3
PATCH 2/3 MX31: Add support for MXC EHCI controller
The patch adds the EHCI controller for the i.MX31 Soc.
--- drivers/usb/host/Makefile | 1 + drivers/usb/host/ehci-mxc.c | 130 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 0 deletions(-) create mode 100644 drivers/usb/host/ehci-mxc.c
drivers/usb/host/Makefile +1 -0
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_USB_SL811HS) += sl811-hcd.o # echi COBJS-$(CONFIG_USB_EHCI) += ehci-hcd.o COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o +COBJS-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o COBJS-$(CONFIG_USB_EHCI_KIRKWOOD) += ehci-kirkwood.o
drivers/usb/host/ehci-mxc.c new file +130 -0
130 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH 3/3 MX31: Add USB Host support to the QONG board
--- board/davedenx/qong/qong.c | 33 +++++++++++++++++++++++++++++++++ include/configs/qong.h | 18 +++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletions(-)
board/davedenx/qong/qong.c +33 -0
@@ -25,6 +25,7 @@#include <netdev.h> #include <asm/arch/mx31.h> #include <asm/arch/mx31-regs.h> +#include <asm/io.h> #include <nand.h> #include <fsl_pmic.h> #include <mxc_gpio.h>
@@ -97,6 +98,38 @@ int board_early_init_f (void)mx31_gpio_mux (MUX_CSPI2_SCLK__CSPI2_CLK );mx31_gpio_mux (MUX_CSPI2_SPI_RDY__CSPI2_DATAREADY_B ); +/* Setup pins for USB2 Host */ +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_USBH2_CLK ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_USBH2_DIR ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_USBH2_NXT ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_USBH2_STP ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_USBH2_DATA0 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_USBH2_DATA1 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_STXD3 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_SRXD3 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_SCK3 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_SFS3 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_STXD6 ,MUX_CTL_FUNC )); +mx31_gpio_mux (IOMUX_MODE (MUX_CTL_SRXD6 ,MUX_CTL_FUNC )); + +#define H2_PAD_CFG (PAD_CTL_DRV_MAX | PAD_CTL_SRE_FAST | PAD_CTL_HYS_CMOS | \ + PAD_CTL_ODE_CMOS | PAD_CTL_100K_PU) + +mx31_set_pad (MX31_PIN_USBH2_CLK ,H2_PAD_CFG ); +mx31_set_pad (MX31_PIN_USBH2_DIR ,H2_PAD_CFG ); +mx31_set_pad (MX31_PIN_USBH2_NXT ,H2_PAD_CFG ); +mx31_set_pad (MX31_PIN_USBH2_STP ,H2_PAD_CFG ); +mx31_set_pad (MX31_PIN_USBH2_DATA0 ,H2_PAD_CFG );/* USBH2_DATA0 */ +mx31_set_pad (MX31_PIN_USBH2_DATA1 ,H2_PAD_CFG );/* USBH2_DATA1 */ +mx31_set_pad (MX31_PIN_SRXD6 ,H2_PAD_CFG );/* USBH2_DATA2 */ +mx31_set_pad (MX31_PIN_STXD6 ,H2_PAD_CFG );/* USBH2_DATA3 */ +mx31_set_pad (MX31_PIN_SFS3 ,H2_PAD_CFG );/* USBH2_DATA4 */ +mx31_set_pad (MX31_PIN_SCK3 ,H2_PAD_CFG );/* USBH2_DATA5 */ +mx31_set_pad (MX31_PIN_SRXD3 ,H2_PAD_CFG );/* USBH2_DATA6 */ +mx31_set_pad (MX31_PIN_STXD3 ,H2_PAD_CFG );/* USBH2_DATA7 */ + +writel (readl ((IOMUXC_BASE +0x8 )) | (1 <<11 ),IOMUXC_BASE +0x8 ); +return 0 ; }
include/configs/qong.h +17 -1
@@ -89,6 +89,22 @@#define CONFIG_BMP_16BPP #define CONFIG_DISPLAY_COM57H5M10XRC +/* USB */ +#define CONFIG_CMD_USB +#ifdef CONFIG_CMD_USB +#define CONFIG_USB_EHCI /* Enable EHCI USB support */ +#define CONFIG_USB_EHCI_MXC +#define CONFIG_EHCI_HCD_INIT_AFTER_RESET +#define CONFIG_MXC_USB_PORT 2 +#define CONFIG_MXC_USB_PORTSC (MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT) +#define CONFIG_MXC_USB_FLAGS MXC_EHCI_POWER_PINS_ENABLED +#define CONFIG_EHCI_IS_TDI +#define CONFIG_USB_STORAGE +#define CONFIG_DOS_PARTITION +#define CONFIG_SUPPORT_VFAT +#define CONFIG_CMD_FAT +#endif /* CONFIG_CMD_USB */ +/* * Reducing the ARP timeout from default 5 seconds to 200ms we speed up the * initial TFTP transfer, should the user wish one, significantly.
@@ -250,7 +266,7 @@ extern int qong_nand_rdy(void *chip);#define CONFIG_ENV_IS_IN_FLASH 1#define CONFIG_ENV_SECT_SIZE 0x20000#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE -#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x60000) +#define CONFIG_ENV_ADDR (CONFIG_SYS_FLASH_BASE + 0x80000)/* Address and size of Redundant Environment Sector */ #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
Signature · 1 line
1.6.3.3
PATCH 3/3 MX31: Add USB Host support to the QONG board
Dear Remy,
Quoted 5 lines · In message <[email protected]> you wrote:
Signed-off-by Stefano Babic <[email protected]>--- board/davedenx/qong/qong.c | 33 +++++++++++++++++++++++++++++++++ include/configs/qong.h | 18 +++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletions(-)
even though USB related, this looks like a board specific patch to me. Is it OK with you that Stefano pulls this through the iMX repository?
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de A conservative is a man who believes that nothing should be done for the first time. - Alfred E. Wiggam
PATCH 3/3 MX31: Add USB Host support to the QONG board
Hi,
2010/10/11 Wolfgang Denk <[email protected]>:
Quoted 12 lines
Dear Remy,
Quoted 5 lines · In message <[email protected]> you wrote:
Signed-off-by Stefano Babic <[email protected]>---
?board/davedenx/qong/qong.c | ? 33 +++++++++++++++++++++++++++++++++ ?include/configs/qong.h ? ? | ? 18 +++++++++++++++++-
?2 files changed, 50 insertions(+), 1 deletions(-)even though USB related, this looks like a board specific patch to me. Is it OK with you that Stefano pulls this through the iMX repository?
OK with me.
Remy
PATCH 3/3 MX31: Add USB Host support to the QONG board
Quoted 6 lines · Remy Bohmer
Quoted 3 lines
even though USB related, this looks like a board specific patch to me. Is it OK with you that Stefano pulls this through the iMX repository?
OK with me.
Hi Remy,
thanks - I will merge in u-boot-imx and sent the pull request to Wolfgang
Stefano
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================