[Armadeus-commitlog] armadeus branch, master, updated. release-3.3-150-g9b6b500
Brought to you by:
sszy
|
From: Julien B a. A. <ar...@us...> - 2010-11-30 16:53:15
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via 9b6b500b51a910037532f8f8614b4a80ace307b8 (commit)
via 8d45afd319b2b917c03ef2a26342cdd6a5d56a5f (commit)
from 41dbd71d8fed4412622a9a0f252c1b1d80af9f5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9b6b500b51a910037532f8f8614b4a80ace307b8
Author: Julien Boibessot <jul...@ar...>
Date: Tue Nov 30 17:52:29 2010 +0100
[LINUX] 2.6.36: Add support for USB Host 1, Ethernet and NAND for APF51
commit 8d45afd319b2b917c03ef2a26342cdd6a5d56a5f
Author: Julien Boibessot <jul...@ar...>
Date: Tue Nov 30 17:49:15 2010 +0100
[BUILD] ARMADEUS_ROOTFS_TAR wasn't correctly set for BR 2010
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 3 +-
.../2.6.36/400-armadeus-add_apf51_module.patch | 225 +++++++++++++++++++-
2 files changed, 216 insertions(+), 12 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index db0d67c..efbd8a2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -47,15 +47,14 @@ BUILDROOT_TOOLCHAIN_BUILD_DIR:=$(BUILDROOT_DIR)/toolchain_build_$(ARMADEUS_TARGE
BUILDROOT_BUILD_DIR:=$(BUILDROOT_DIR)/build_$(ARMADEUS_TARGET_ARCH)
ARMADEUS_BINARIES:=$(BUILDROOT_DIR)/binaries/$(ARMADEUS_PROJECT_NAME)
ARMADEUS_ROOTFS_DIR:=$(BUILDROOT_PROJECT_BUILD_DIR)/root
-ARMADEUS_ROOTFS_TAR:=$(ARMADEUS_BINARIES)/$(ARMADEUS_BOARD_NAME)-rootfs.arm.tar
else
BUILDROOT_PROJECT_BUILD_DIR:=$(BUILDROOT_DIR)/output/build
BUILDROOT_TOOLCHAIN_BUILD_DIR:=$(BUILDROOT_DIR)/output/toolchain
BUILDROOT_BUILD_DIR:=$(BUILDROOT_DIR)/output/build
ARMADEUS_BINARIES:=$(BUILDROOT_DIR)/output/images
ARMADEUS_ROOTFS_DIR:=$(BUILDROOT_DIR)/output/target
-ARMADEUS_ROOTFS_TAR:=$(ARMADEUS_BINARIES)/rootfs.tar
endif
+ARMADEUS_ROOTFS_TAR:=$(ARMADEUS_BINARIES)/$(ARMADEUS_BOARD_NAME)-rootfs.arm.tar
ARMADEUS_LINUX_DIR:=$(BUILDROOT_PROJECT_BUILD_DIR)/linux-$(ARMADEUS_LINUX_VERSION)
ARMADEUS_LINUX_PATCH_DIR:=$(BUILDROOT_DIR)/target/device/armadeus/linux/kernel-patches/$(ARMADEUS_LINUX_VERSION)
diff --git a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/400-armadeus-add_apf51_module.patch b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/400-armadeus-add_apf51_module.patch
index 34924b2..d18ff91 100644
--- a/buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/400-armadeus-add_apf51_module.patch
+++ b/buildroot/target/device/armadeus/linux/kernel-patches/2.6.36/400-armadeus-add_apf51_module.patch
@@ -1,13 +1,14 @@
Index: linux-2.6.36/arch/arm/mach-mx5/Kconfig
===================================================================
---- linux-2.6.36.orig/arch/arm/mach-mx5/Kconfig 2010-10-20 22:30:22.000000000 +0200
-+++ linux-2.6.36/arch/arm/mach-mx5/Kconfig 2010-11-11 11:32:41.000000000 +0100
-@@ -42,4 +42,10 @@
+--- linux-2.6.36.orig/arch/arm/mach-mx5/Kconfig 2010-11-30 16:25:47.000000000 +0100
++++ linux-2.6.36/arch/arm/mach-mx5/Kconfig 2010-11-30 16:25:56.000000000 +0100
+@@ -42,4 +42,11 @@
endchoice
+config MACH_ARMADEUS_APF51
+ bool "Support Armadeus APF51"
++ select MXC_ULPI
+ help
+ Include support for Armadeus Systems APF51 System On Module. This
+ includes specific configurations for the board and its peripherals.
@@ -15,8 +16,8 @@ Index: linux-2.6.36/arch/arm/mach-mx5/Kconfig
endif
Index: linux-2.6.36/arch/arm/mach-mx5/Makefile
===================================================================
---- linux-2.6.36.orig/arch/arm/mach-mx5/Makefile 2010-10-20 22:30:22.000000000 +0200
-+++ linux-2.6.36/arch/arm/mach-mx5/Makefile 2010-11-11 11:32:41.000000000 +0100
+--- linux-2.6.36.orig/arch/arm/mach-mx5/Makefile 2010-11-30 16:25:47.000000000 +0100
++++ linux-2.6.36/arch/arm/mach-mx5/Makefile 2010-11-30 16:25:56.000000000 +0100
@@ -9,3 +9,4 @@
obj-$(CONFIG_MACH_MX51_3DS) += board-mx51_3ds.o
obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += board-cpuimx51.o
@@ -25,8 +26,8 @@ Index: linux-2.6.36/arch/arm/mach-mx5/Makefile
Index: linux-2.6.36/arch/arm/mach-mx5/board-apf51.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.36/arch/arm/mach-mx5/board-apf51.c 2010-11-11 11:32:41.000000000 +0100
-@@ -0,0 +1,97 @@
++++ linux-2.6.36/arch/arm/mach-mx5/board-apf51.c 2010-11-30 16:32:59.000000000 +0100
+@@ -0,0 +1,301 @@
+/*
+ * Copyright 2010 Armadeus Systems
+ *
@@ -42,6 +43,10 @@ Index: linux-2.6.36/arch/arm/mach-mx5/board-apf51.c
+ */
+
+#include <linux/gpio.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/delay.h>
++#include <linux/usb/otg.h>
+
+#include <asm/mach-types.h>
+#include <asm/mach/arch.h>
@@ -51,15 +56,38 @@ Index: linux-2.6.36/arch/arm/mach-mx5/board-apf51.c
+#include <mach/common.h>
+#include <mach/iomux-mx51.h>
+#include <mach/imx-uart.h>
++#include <mach/mxc_nand.h>
++#include <mach/mxc_ehci.h>
++#include <mach/ulpi.h>
+
+#include "devices.h"
+
++/* USB_CTRL_1 */
++#define MX51_USB_CTRL_1_OFFSET 0x10
++#define MX51_USB_CTRL_UH1_EXT_CLK_EN (1 << 25)
++
+
+static struct pad_desc apf51_pads[] = {
+ /* UART2 (Console) */
+ MX51_PAD_UART2_RXD__UART2_RXD,
+ MX51_PAD_UART2_TXD__UART2_TXD,
+
++ /* USB HOST1 */
++ MX51_PAD_USBH1_CLK__USBH1_CLK,
++ MX51_PAD_USBH1_DIR__USBH1_DIR,
++ MX51_PAD_USBH1_NXT__USBH1_NXT,
++ MX51_PAD_USBH1_DATA0__USBH1_DATA0,
++ MX51_PAD_USBH1_DATA1__USBH1_DATA1,
++ MX51_PAD_USBH1_DATA2__USBH1_DATA2,
++ MX51_PAD_USBH1_DATA3__USBH1_DATA3,
++ MX51_PAD_USBH1_DATA4__USBH1_DATA4,
++ MX51_PAD_USBH1_DATA5__USBH1_DATA5,
++ MX51_PAD_USBH1_DATA6__USBH1_DATA6,
++ MX51_PAD_USBH1_DATA7__USBH1_DATA7,
++ MX51_PAD_USBH1_STP__USBH1_STP,
++
++ /* USB HOST2 */
++
+ /* Debug PINS */
+/* MX51_PAD_GPIO_1_2__GPIO_1_2,
+ MX51_PAD_GPIO_1_3__GPIO_1_3,*/
@@ -82,6 +110,176 @@ Index: linux-2.6.36/arch/arm/mach-mx5/board-apf51.c
+#endif /* SERIAL_IMX */
+
+
++/* APF51 has a 512MB+ 3,3V Micron NAND flash, 8 bits width */
++static struct mxc_nand_platform_data apf51_nand_board_info __initconst = {
++ .width = 1,
++ .hw_ecc = 1,
++ .flash_bbt = 1, /* we handle Bad Block Table */
++};
++
++/* APF51 has an Ethernet PHY connected on internal FEC */
++static struct platform_device *platform_devices[] __initdata = {
++#ifdef CONFIG_FEC
++ &mxc_fec_device,
++#endif
++};
++
++
++/* APF51 has 2 PHYs on USB Host port 1 & 2 */
++
++static int initialize_usbh1_port(struct platform_device *pdev)
++{
++ u32 v;
++ void __iomem *usb_base;
++ u32 usbother_base;
++
++ usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K);
++ usbother_base = (u32)(usb_base + MX5_USBOTHER_REGS_OFFSET);
++
++ /* The clock for the USBH1 ULPI port will come externally from the PHY. */
++ v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET);
++ __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET);
++ iounmap(usb_base);
++
++ return 0;
++}
++
++/* ULPI register addresses */
++#define ULPI_VID_LOW 0x00 /* Vendor ID low */
++#define ULPI_VID_HIGH 0x01 /* Vendor ID high */
++#define ULPI_PID_LOW 0x02 /* Product ID low */
++#define ULPI_PID_HIGH 0x03 /* Product ID high */
++#define ULPI_FCNCTL 0x04 /* Function Control */
++#define ULPI_ITFCTL 0x07 /* Interface Control */
++#define ULPI_OTGCTL 0x0A /* OTG Control */
++
++/* 1504 Function Control Register bits */
++#define RESET (1 << 5) /* Reset */
++
++/* 1504 OTG Control Register bits */
++#define USE_EXT_VBUS_IND (1 << 7) /* Use ext. Vbus indicator */
++#define DRV_VBUS_EXT (1 << 6) /* Drive Vbus external */
++#define DRV_VBUS (1 << 5) /* Drive Vbus */
++#define CHRG_VBUS (1 << 4) /* Charge Vbus */
++#define DISCHRG_VBUS (1 << 3) /* Discharge Vbus */
++#define DM_PULL_DOWN (1 << 2) /* enable DM Pull Down */
++#define DP_PULL_DOWN (1 << 1) /* enable DP Pull Down */
++#define ID_PULL_UP (1 << 0) /* enable ID Pull Up */
++
++
++/* ?? Preferably use stuff from drivers/usb/otg/ulpi.c ?? */
++static int usb3320_init(struct otg_transceiver *otg)
++{
++ int vid, pid;
++
++ printk("*** %s ***\n", __func__);
++
++ vid = otg->io_ops->read(otg, ULPI_VID_HIGH) << 8;
++ vid = vid | otg->io_ops->read(otg, ULPI_VID_LOW);
++
++ pid = otg->io_ops->read(otg, ULPI_PID_HIGH) << 8;
++ pid = pid | otg->io_ops->read(otg, ULPI_PID_LOW);
++
++ pr_info("ULPI OTG Vendor ID 0x%x Product ID 0x%x\n", vid, pid);
++ if (vid != 0x424 || pid != 0x07) {
++ pr_err("No USB3320 found\n");
++ return -1;
++ }
++
++ return 0;
++}
++
++/* ?? Preferably use stuff from drivers/usb/otg/ulpi.c ?? */
++static int usb3320_set_vbus(struct otg_transceiver *otg, bool enabled)
++{
++ int ret = 0;
++ int reg;
++
++ printk("*** %s: %d\n", __func__, enabled);
++
++ if (enabled) {
++ /* force disconnection of the DM/DP signals. This
++ avoid powering the connected device through these lines */
++ reg = otg->io_ops->read(otg, ULPI_FCNCTL);
++ reg |= RESET;
++ otg->io_ops->write(otg, reg, ULPI_FCNCTL);
++ mdelay(10); /* wait until the supply is really down */
++ reg = otg->io_ops->read(otg, ULPI_FCNCTL);
++ reg &= ~RESET;
++ otg->io_ops->write(otg, reg, ULPI_FCNCTL);
++ mdelay(1);
++
++ reg = otg->io_ops->read(otg, ULPI_OTGCTL);
++ reg |= DRV_VBUS_EXT | /* enable external Vbus */
++ DRV_VBUS | /* enable internal Vbus */
++ USE_EXT_VBUS_IND | /* use external indicator */
++ CHRG_VBUS; /* charge Vbus */
++ otg->io_ops->write(otg, reg, ULPI_OTGCTL);
++ } else {
++ reg = otg->io_ops->read(otg, ULPI_OTGCTL);
++ reg &= ~(DRV_VBUS_EXT | /* disable external Vbus */
++ DRV_VBUS); /* disable internal Vbus */
++ reg |= USE_EXT_VBUS_IND | /* use external indicator */
++ DISCHRG_VBUS; /* discharge Vbus */
++ otg->io_ops->write(otg, reg, ULPI_OTGCTL);
++ }
++
++ return ret;
++}
++
++/* ?? Preferably use otg_ulpi_create from drivers/usb/otg/ulpi.c ?? */
++struct otg_transceiver usb3320_1 = {
++ .io_ops = &mxc_ulpi_access_ops,
++ .init = usb3320_init,
++ .set_vbus = usb3320_set_vbus,
++};
++
++static struct mxc_usbh_platform_data usbh1_config = {
++ .init = initialize_usbh1_port,
++ .portsc = MXC_EHCI_MODE_ULPI,
++ .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD),
++ .otg = &usb3320_1,
++};
++
++#define APF51_USBH1_STP (0*32 + 27) /* GPIO_1_27 */
++#define APF51_USB_HOST_PHY_RESET (2*32 +1) /* GPIO_3_1 */
++
++static int apf51_usbh1_active(void)
++{
++ struct pad_desc phyreset_gpio = MX51_PAD_DI1_PIN12__GPIO_3_1;
++ int ret;
++#if 0
++ struct pad_desc usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO_1_27;
++
++ /* Set USBH1_STP to GPIO and toggle it */
++ mxc_iomux_v3_setup_pad(&usbh1stp_gpio);
++ ret = gpio_request(APF51_USBH1_STP, "usbh1_stp");
++
++ if (ret) {
++ pr_debug("failed to get MX51_PAD_USBH1_STP__GPIO_1_27: %d\n", ret);
++ return ret;
++ }
++ gpio_direction_output(APF51_USBH1_STP, 0);
++ gpio_set_value(APF51_USBH1_STP, 1);
++ msleep(100);
++ gpio_free(APF51_USBH1_STP);
++#endif
++
++ /* De-assert USB PHY RESETB */
++ mxc_iomux_v3_setup_pad(&phyreset_gpio);
++ ret = gpio_request(APF51_USB_HOST_PHY_RESET, "phy_reset");
++
++ if (ret) {
++ pr_debug("failed to get MX51_PAD_DI1_PIN12__GPIO_3_1: %d\n", ret);
++ return ret;
++ }
++ gpio_direction_output(APF51_USB_HOST_PHY_RESET, 1);
++ msleep(50);
++
++ return 0;
++}
++
++
+#define DEBUG1_GPIO (GPIO_PORTA | 2)
+#define DEBUG2_GPIO (GPIO_PORTA | 3)
+/*
@@ -99,6 +297,13 @@ Index: linux-2.6.36/arch/arm/mach-mx5/board-apf51.c
+ gpio_set_value(DEBUG2_GPIO, 1);
+
+ apf51_init_imx_uart();
++
++ mxc_register_device(&mxc_nand_device, &apf51_nand_board_info);
++ platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
++
++ apf51_usbh1_active();
++ mxc_register_device(&mxc_usbh1_device, &usbh1_config);
++
+#ifdef CONFIG_MACH_ARMADEUS_APF51_BASEBOARD
+ apf51_baseboard_init();
+#endif
@@ -126,8 +331,8 @@ Index: linux-2.6.36/arch/arm/mach-mx5/board-apf51.c
+
Index: linux-2.6.36/arch/arm/plat-mxc/include/mach/uncompress.h
===================================================================
---- linux-2.6.36.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2010-11-11 12:22:51.000000000 +0100
-+++ linux-2.6.36/arch/arm/plat-mxc/include/mach/uncompress.h 2010-11-11 12:23:44.000000000 +0100
+--- linux-2.6.36.orig/arch/arm/plat-mxc/include/mach/uncompress.h 2010-11-30 16:25:55.000000000 +0100
++++ linux-2.6.36/arch/arm/plat-mxc/include/mach/uncompress.h 2010-11-30 16:25:56.000000000 +0100
@@ -63,6 +63,7 @@
#define MX3X_UART1_BASE_ADDR 0x43F90000
#define MX3X_UART2_BASE_ADDR 0x43F94000
@@ -136,7 +341,7 @@ Index: linux-2.6.36/arch/arm/plat-mxc/include/mach/uncompress.h
static __inline__ void __arch_decomp_setup(unsigned long arch_id)
{
-@@ -101,6 +102,9 @@
+@@ -102,6 +103,9 @@
case MACH_TYPE_MX51_BABBAGE:
uart_base = MX51_UART1_BASE_ADDR;
break;
hooks/post-receive
--
armadeus
|