From 080ce045fb9fbd79affe844312c32f87c5a2074f Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Tue, 13 Mar 2012 18:41:58 +0100 Subject: [PATCH] kernel: exchange pandaboard patches. --- lfs/linux3 | 9 +- .../linux-2.6.40-pandaboard-dvi720p.patch | 51 ++++++ ... => linux-2.6.40-pandaboard-i2c-fix.patch} | 0 .../linux-2.6.40-pandaboard-wlan-fix.patch | 12 ++ ...inux-2.x-smsc95xx-add_mac_addr_param.patch | 149 ++++++++++++++++++ src/patches/panda-usb-power.patch | 68 -------- 6 files changed, 218 insertions(+), 71 deletions(-) create mode 100755 src/patches/linux-2.6.40-pandaboard-dvi720p.patch rename src/patches/{panda-i2c.patch => linux-2.6.40-pandaboard-i2c-fix.patch} (100%) create mode 100755 src/patches/linux-2.6.40-pandaboard-wlan-fix.patch create mode 100755 src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch delete mode 100755 src/patches/panda-usb-power.patch diff --git a/lfs/linux3 b/lfs/linux3 index d8042a291d..344c8aedf9 100644 --- a/lfs/linux3 +++ b/lfs/linux3 @@ -189,9 +189,12 @@ ifeq "$(MACHINE_TYPE)" "arm" endif ifeq "$(KCFG)" "-omap" - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/panda-usb-power.patch - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/panda-i2c.patch - cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.0.23-panda-sound.patch +# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/panda-usb-power.patch +# + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.40-pandaboard-wlan-fix.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.40-pandaboard-dvi720p.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.40-pandaboard-i2c-fix.patch + cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch endif ifeq "$(HEADERS)" "1" diff --git a/src/patches/linux-2.6.40-pandaboard-dvi720p.patch b/src/patches/linux-2.6.40-pandaboard-dvi720p.patch new file mode 100755 index 0000000000..8ec3586de3 --- /dev/null +++ b/src/patches/linux-2.6.40-pandaboard-dvi720p.patch @@ -0,0 +1,51 @@ +diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c +index 90485fc..7a92185 100644 +--- a/arch/arm/mach-omap2/board-omap4panda.c ++++ b/arch/arm/mach-omap2/board-omap4panda.c +@@ -583,7 +583,7 @@ static void omap4_panda_disable_dvi(struct omap_dss_device *dssdev) + + /* Using generic display panel */ + static struct panel_generic_dpi_data omap4_dvi_panel = { +- .name = "generic", ++ .name = "dvi_720p", + .platform_enable = omap4_panda_enable_dvi, + .platform_disable = omap4_panda_disable_dvi, + }; +diff --git a/drivers/video/omap2/displays/panel-generic-dpi.c b/drivers/video/omap2/displays/panel-generic-dpi.c +index 9c90f75..af8352f 100644 +--- a/drivers/video/omap2/displays/panel-generic-dpi.c ++++ b/drivers/video/omap2/displays/panel-generic-dpi.c +@@ -232,7 +232,32 @@ static struct panel_config generic_dpi_panels[] = { + .power_off_delay = 0, + .name = "powertip_ph480272t", + }, +-}; ++ ++ /* Vesa 720p 1280x768 */ ++ { ++ { ++ .x_res = 1280, ++ .y_res = 768, ++ ++ .pixel_clock = 71000, ++ ++ .hfp = 128, ++ .hsw = 64, ++ .hbp = 192, ++ ++ .vfp = 3, ++ .vsw = 7, ++ .vbp = 20, ++ }, ++ .acbi = 0x0, ++ .acb = 0x0, ++ .config = OMAP_DSS_LCD_TFT, ++ .power_on_delay = 0, ++ .power_off_delay = 0, ++ .name = "dvi_720p", ++ }, ++ }; ++ + + struct panel_drv_data { + diff --git a/src/patches/panda-i2c.patch b/src/patches/linux-2.6.40-pandaboard-i2c-fix.patch similarity index 100% rename from src/patches/panda-i2c.patch rename to src/patches/linux-2.6.40-pandaboard-i2c-fix.patch diff --git a/src/patches/linux-2.6.40-pandaboard-wlan-fix.patch b/src/patches/linux-2.6.40-pandaboard-wlan-fix.patch new file mode 100755 index 0000000000..1b6b5c4d75 --- /dev/null +++ b/src/patches/linux-2.6.40-pandaboard-wlan-fix.patch @@ -0,0 +1,12 @@ +diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c +index 1269658..8ec6330 100644 +--- a/arch/arm/mach-omap2/board-omap4panda.c ++++ b/arch/arm/mach-omap2/board-omap4panda.c +@@ -377,6 +377,7 @@ static struct regulator_init_data omap4_panda_vusb = { + static struct regulator_init_data omap4_panda_clk32kg = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, ++ .always_on = true, + }, + }; + diff --git a/src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch b/src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch new file mode 100755 index 0000000000..2aea1d1ff3 --- /dev/null +++ b/src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch @@ -0,0 +1,149 @@ +Added smsc95xx.macaddr module parameter to allow the user to +change the MAC address on boot if there was no MAC on the EEPROM. + +The parameter take the MAC address in 01:23:45:67:89:ab format and +needs to be locally assigned. The MAC get assigned to the first +smsc95xx device with no MAC on EEPROM (which resulted in a random +MAC before). If there is more than one device without MAC on +EEPROM and the user needs set the MAC to a specific device, it +can be done by attaching the netdev name (e.g. eth0) to the +smsc95xx.macaddr parameter seperated by a ';' as e.g. in +'01:23:45:67:89:ab;eth0' + +This allows e.g. u-boot to pass on PandaBoard or BeagleBoard +the by u-boot generated static MAC address to the kernel device +to ensure the MAC stays the same during the whole boot process. + +Signed-off-by: Danny Kukawka +--- + drivers/net/usb/smsc95xx.c | 85 ++++++++++++++++++++++++++++++++++++++++++-- + 1 files changed, 82 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index d45520e..3198c7d 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -52,6 +52,8 @@ struct smsc95xx_priv { + u32 hash_hi; + u32 hash_lo; + spinlock_t mac_cr_lock; ++ bool mac_set_from_param; ++ bool mac_is_random; + }; + + struct usb_context { +@@ -63,6 +65,11 @@ static bool turbo_mode = true; + module_param(turbo_mode, bool, 0644); + MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); + ++static char *macaddr = ":"; ++static bool set_macaddr = false; ++module_param(macaddr, charp, 0); ++MODULE_PARM_DESC(macaddr, " macaddr=macaddr;[tgt-netdevname] (Set MAC only if there is a device without MAC on EEPROM)"); ++ + static int smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data) + { + u32 *buf = kmalloc(4, GFP_KERNEL); +@@ -601,8 +608,71 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) + return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); + } + ++/* set mac address from the macaddr module parameter */ ++static int smsc95xx_init_mac_address_from_param(struct usbnet *dev) ++{ ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ int i, parsed, ret; ++ u8 mtbl[ETH_ALEN]; ++ char *input = NULL; ++ char *config_param = NULL; ++ char *netdev_name = NULL; ++ ++ parsed = 0; ++ ret = 0; ++ ++ input = kstrdup(macaddr, GFP_KERNEL); ++ ++ if (!input) ++ return -ENOMEM; ++ ++ if (strlen(input) >= 17) { ++ while ((config_param = strsep(&input, ";"))) { ++ if (parsed == 0) { ++ if (!mac_pton(config_param, mtbl)) { ++ ret = 1; ++ goto parse_err; ++ } ++ } else { ++ netdev_name = config_param; ++ } ++ parsed ++; ++ } ++ ++ if (parsed && is_valid_ether_addr(mtbl)) { ++ if (netdev_name && strlen(netdev_name)) { ++ if (strcmp(netdev_name, dev->net->name) != 0) { ++ netif_dbg(dev, ifup, dev->net, "requested devname (%s) didn't match (%s)\n", netdev_name, dev->net->name); ++ ret = 1; ++ goto out; ++ } ++ } ++ ++ for (i = 0; i < ETH_ALEN; i++) { ++ dev->net->dev_addr[i] = mtbl[i]; ++ } ++ ++ netif_dbg(dev, ifup, dev->net, "set valid MAC address from smsc95xx.macaddr\n"); ++ set_macaddr = true; ++ pdata->mac_set_from_param = true; ++ pdata->mac_is_random = false; ++ goto out; ++ } ++ } ++ ++parse_err: ++ netif_dbg(dev, ifup, dev->net, "failed to parse (valid) MAC from smsc95xx.macaddr\n"); ++ set_macaddr = true; ++out: ++ if (input) ++ kfree(input); ++ return ret; ++} ++ + static void smsc95xx_init_mac_address(struct usbnet *dev) + { ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ + /* try reading mac address from EEPROM */ + if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN, + dev->net->dev_addr) == 0) { +@@ -615,16 +685,25 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) + + /* no eeprom, or eeprom values are invalid. generate random MAC */ + random_ether_addr(dev->net->dev_addr); ++ pdata->mac_is_random = true; + netif_dbg(dev, ifup, dev->net, "MAC address set to random_ether_addr\n"); + } + + static int smsc95xx_set_mac_address(struct usbnet *dev) + { +- u32 addr_lo = dev->net->dev_addr[0] | dev->net->dev_addr[1] << 8 | +- dev->net->dev_addr[2] << 16 | dev->net->dev_addr[3] << 24; +- u32 addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8; ++ struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); ++ u32 addr_lo, addr_hi; + int ret; + ++ if (pdata->mac_is_random && !pdata->mac_set_from_param && !set_macaddr) { ++ netif_dbg(dev, ifup, dev->net, "random MAC address, not yet set from smsc95xx.macaddr, try to set it ...\n"); ++ smsc95xx_init_mac_address_from_param(dev); ++ } ++ ++ addr_lo = dev->net->dev_addr[0] | dev->net->dev_addr[1] << 8 | ++ dev->net->dev_addr[2] << 16 | dev->net->dev_addr[3] << 24; ++ addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8; ++ + ret = smsc95xx_write_reg(dev, ADDRL, addr_lo); + if (ret < 0) { + netdev_warn(dev->net, "Failed to write ADDRL: %d\n", ret); +-- + diff --git a/src/patches/panda-usb-power.patch b/src/patches/panda-usb-power.patch deleted file mode 100755 index 9f130ef9e8..0000000000 --- a/src/patches/panda-usb-power.patch +++ /dev/null @@ -1,68 +0,0 @@ -VUSB is a fixed level line and hence have no set_voltage -callback in regulator ops, but has apply_uV set to true. -As a result it fails to register with the regulator core. -Remove setting apply_uV. - -Also, assign name to VUSB supply, without which regulator core -fails to find it and assigns the default 'dummy' regulator to -the ehci-omap device. - -Signed-off-by: Jassi Brar ---- - arch/arm/mach-omap2/board-4430sdp.c | 6 +++++- - arch/arm/mach-omap2/board-omap4panda.c | 6 +++++- - 2 files changed, 10 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c -index 63de2d3..1ec60be 100644 ---- a/arch/arm/mach-omap2/board-4430sdp.c -+++ b/arch/arm/mach-omap2/board-4430sdp.c -@@ -504,16 +504,20 @@ static struct regulator_init_data sdp4430_vdac = { - }, - }; - -+static struct regulator_consumer_supply sdp4430_vusb_supply = -+ REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"); -+ - static struct regulator_init_data sdp4430_vusb = { - .constraints = { - .min_uV = 3300000, - .max_uV = 3300000, -- .apply_uV = true, - .valid_modes_mask = REGULATOR_MODE_NORMAL - | REGULATOR_MODE_STANDBY, - .valid_ops_mask = REGULATOR_CHANGE_MODE - | REGULATOR_CHANGE_STATUS, - }, -+ .num_consumer_supplies = 1, -+ .consumer_supplies = &sdp4430_vusb_supply, - }; - - static struct regulator_init_data sdp4430_clk32kg = { -diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c -index d4f9879..7429f7e 100644 ---- a/arch/arm/mach-omap2/board-omap4panda.c -+++ b/arch/arm/mach-omap2/board-omap4panda.c -@@ -362,16 +362,20 @@ static struct regulator_init_data omap4_panda_vdac = { - }, - }; - -+static struct regulator_consumer_supply omap4_panda_vusb_supply = -+ REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"); -+ - static struct regulator_init_data omap4_panda_vusb = { - .constraints = { - .min_uV = 3300000, - .max_uV = 3300000, -- .apply_uV = true, - .valid_modes_mask = REGULATOR_MODE_NORMAL - | REGULATOR_MODE_STANDBY, - .valid_ops_mask = REGULATOR_CHANGE_MODE - | REGULATOR_CHANGE_STATUS, - }, -+ .num_consumer_supplies = 1, -+ .consumer_supplies = &omap4_panda_vusb_supply, - }; - - static struct regulator_init_data omap4_panda_clk32kg = { --- \ No newline at end of file -- 2.39.2