[Maverick][PATCH] UBUNTU: SAUCE: Enable USB and Ethernet on the XM

Tim Gardner tcanonical at tpi.com
Tue Jul 20 16:06:30 UTC 2010


On 07/20/2010 05:25 PM, Lee Jones wrote:
>  From a2f11a44e5834d75611c88af69036cfe26eddf05 Mon Sep 17 00:00:00 2001
> From: Lee Jones<lee.jones at canonical.com>
> Date: Tue, 20 Jul 2010 16:54:12 +0200
> Subject: [PATCH] UBUNTU: SAUCE: Enable USB and Ethernet on the XM
>
> Provide the required setup to enable USB Ethernet (usb0)
> and USB host on the XM Beagleboard (A rev).
>
> Signed-off-by: Lee Jones<lee.jones at canonical.com>
> ---
>   arch/arm/mach-omap2/board-omap3beagle.c |   32 +++++++++++------
>   arch/arm/plat-omap/include/plat/cpu.h   |   56 +++++++++++++++++++++++++++++++
>   drivers/video/omap2/dss/dispc.c         |    4 +-
>   drivers/video/omap2/dss/dpi.c           |    7 +++-
>   4 files changed, 85 insertions(+), 14 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index 32565dc..7a1b351 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -171,6 +171,11 @@ static void __init beagle_display_init(void)
>   {
>   	int r;
>
> +       if (cpu_is_omap3630())
> +               beagle_dvi_device.reset_gpio = 129;
> +       else
> +               beagle_dvi_device.reset_gpio = 170;
> +
>   	r = gpio_request(beagle_dvi_device.reset_gpio, "DVI reset");
>   	if (r<  0) {
>   		printk(KERN_ERR "Unable to get DVI reset GPIO\n");
> @@ -222,12 +227,22 @@ static int beagle_twl_gpio_setup(struct device *dev,
>   	 * power switch and overcurrent detect
>   	 */
>
> -	gpio_request(gpio + 1, "EHCI_nOC");
> -	gpio_direction_input(gpio + 1);
> -
> -	/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
> -	gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
> -	gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
> +       if (cpu_is_omap3630()) {
> +               gpio_request(gpio + 1, "nDVI_PWR_EN");
> +               gpio_direction_output(gpio + 1, 0);
> +
> +               /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
> +               gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
> +               gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1);
> +       }
> +       else {
> +               gpio_request(gpio + 1, "EHCI_nOC");
> +               gpio_direction_input(gpio + 1);
> +
> +               /* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */
> +               gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR");
> +               gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0);
> +       }
>
>   	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
>   	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
> @@ -492,11 +507,6 @@ static void __init omap3_beagle_init(void)
>   			ARRAY_SIZE(omap3_beagle_devices));
>   	omap_serial_init();
>
> -	omap_mux_init_gpio(170, OMAP_PIN_INPUT);
> -	gpio_request(170, "DVI_nPD");
> -	/* REVISIT leave DVI powered down until it's needed ... */
> -	gpio_direction_output(170, true);
> -
>   	usb_musb_init(&musb_board_data);
>   	usb_ehci_init(&ehci_pdata);
>   	omap3beagle_flash_init();
> diff --git a/arch/arm/plat-omap/include/plat/cpu.h b/arch/arm/plat-omap/include/plat/cpu.h
> index 7514174..5e76126 100644
> --- a/arch/arm/plat-omap/include/plat/cpu.h
> +++ b/arch/arm/plat-omap/include/plat/cpu.h
> @@ -389,6 +389,62 @@ IS_OMAP_TYPE(3517, 0x3517)
>   #define OMAP4430_REV_ES1_0	0x44300044
>
>   /*
> + * Silicon revisions
> + */
> +#define OMAP_ES_1_0		0x00
> +#define OMAP_ES_2_0		0x10
> +#define OMAP_ES_2_1		0x20
> +#define OMAP_ES_3_0		0x30
> +#define OMAP_ES_3_1		0x40
> +
> +#define OMAP_REV_MASK		0x0000ff00
> +#define OMAP_REV_BITS		((omap_rev()&  OMAP_REV_MASK)>>  8)
> +
> +#define OMAP_REV_IS(revid)					\
> +static inline u8 omap_rev_is_ ##revid (void)			\
> +{								\
> +	return (OMAP_REV_BITS == OMAP_ES_ ##revid) ? 1 : 0;	\
> +}
> +
> +#define OMAP_REV_LT(revid)					\
> +static inline u8 omap_rev_lt_ ##revid (void)			\
> +{								\
> +	return (OMAP_REV_BITS<  OMAP_ES_ ##revid) ? 1 : 0;	\
> +}
> +
> +#define OMAP_REV_LE(revid)					\
> +static inline u8 omap_rev_le_ ##revid (void)			\
> +{								\
> +	return (OMAP_REV_BITS<= OMAP_ES_ ##revid) ? 1 : 0;	\
> +}
> +
> +#define OMAP_REV_GT(revid)					\
> +static inline u8 omap_rev_gt_ ##revid (void)			\
> +{								\
> +	return (OMAP_REV_BITS>  OMAP_ES_ ##revid) ? 1 : 0;	\
> +}
> +
> +#define OMAP_REV_GE(revid)					\
> +static inline u8 omap_rev_ge_ ##revid (void)			\
> +{								\
> +	return (OMAP_REV_BITS>= OMAP_ES_ ##revid) ? 1 : 0;	\
> +}
> +
> +#define OMAP_REV_FUNCTIONS(revid)	\
> +	OMAP_REV_IS(revid)		\
> +	OMAP_REV_LT(revid)		\
> +	OMAP_REV_LE(revid)		\
> +	OMAP_REV_GT(revid)		\
> +	OMAP_REV_GE(revid)
> +
> +OMAP_REV_FUNCTIONS(1_0)
> +OMAP_REV_FUNCTIONS(2_0)
> +OMAP_REV_FUNCTIONS(2_1)
> +OMAP_REV_FUNCTIONS(3_0)
> +OMAP_REV_FUNCTIONS(3_1)
> +
> +/*
> +
>    * omap_chip bits
>    *
>    * CHIP_IS_OMAP{2420,2430,3430} indicate that a particular structure is
> diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
> index e777e35..6ba87d8 100644
> --- a/drivers/video/omap2/dss/dispc.c
> +++ b/drivers/video/omap2/dss/dispc.c
> @@ -2111,7 +2111,7 @@ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode)
>   static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp,
>   		int vsw, int vfp, int vbp)
>   {
> -	if (cpu_is_omap24xx() || omap_rev()<  OMAP3430_REV_ES3_0) {
> +	if (cpu_is_omap24xx() || (cpu_is_omap34xx()&&  omap_rev_lt_3_0())) {
>   		if (hsw<  1 || hsw>  64 ||
>   				hfp<  1 || hfp>  256 ||
>   				hbp<  1 || hbp>  256 ||
> @@ -2144,7 +2144,7 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp,
>   {
>   	u32 timing_h, timing_v;
>
> -	if (cpu_is_omap24xx() || omap_rev()<  OMAP3430_REV_ES3_0) {
> +	if (cpu_is_omap24xx() || (cpu_is_omap34xx()&&  omap_rev_lt_3_0())) {
>   		timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) |
>   			FLD_VAL(hbp-1, 27, 20);
>
> diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
> index 960e977..23047b6 100644
> --- a/drivers/video/omap2/dss/dpi.c
> +++ b/drivers/video/omap2/dss/dpi.c
> @@ -177,7 +177,12 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
>
>   #ifdef CONFIG_OMAP2_DSS_USE_DSI_PLL
>   	dss_clk_enable(DSS_CLK_FCK2);
> -	r = dsi_pll_init(dssdev, 0, 1);
> +
> +	if (cpu_is_omap3630())
> +		r = dsi_pll_init(dssdev, 1, 1);
> +	else
> +		r = dsi_pll_init(dssdev, 0, 1);
> +
>   	if (r)
>   		goto err3;
>   #endif

So, where does this patch come from? Did you write the whole thing from 
scratch?

rtg
-- 
Tim Gardner tim.gardner at canonical.com




More information about the kernel-team mailing list