BigW Consortium Gitlab

Commit cadee081 by nbd

remove broken targets

Signed-off-by: 's avatarFelix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@45977 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent 7ca37cfb
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=omap24xx
BOARDNAME:=TI OMAP24xx
MAINTAINER:=Michael Buesch <m@bues.ch>
FEATURES:=targz squashfs jffs2_nand usb usbgadget display gpio audio broken
CPU_TYPE:=arm1136j-s
KERNEL_PATCHVER:=4.0
define Target/Description
TI OMAP-24xx
endef
KERNELNAME:=zImage
include $(INCLUDE_DIR)/target.mk
$(eval $(call BuildTarget))
config mount
option target /maemo/initfs
option device /dev/mtdblock3
option fstype jffs2
option options rw,noatime
option enabled 0
config mount
option target /maemo/rootfs
option device /dev/mtdblock4
option fstype jffs2
option options rw,noatime
option enabled 0
config interface loopback
option ifname lo
option proto static
option netmask 255.0.0.0
config interface lan
option proto dhcp
option netmask 255.255.255.0
config interface usb
option ifname usb0
option proto static
option ipaddr 192.168.168.168
option netmask 255.255.255.0
option ip6addr fe80::810:1
config wifi-device radio0
option type mac80211
option phy phy0
option channel auto
# TODO: CHANGE THE MAC-ADDRESS:
option macaddr 00:11:22:33:44:55
option hwmode 11g
# option country DE
# REMOVE THIS LINE TO ENABLE WIFI:
option disabled 1
config wifi-iface
option device radio0
option powersave 1
option network lan
option mode sta
option ssid OpenWrt
# option encryption psk2
# option key "foobar"
#!/bin/sh
n810_cal_bme_pmm_extract() {
[ -x /usr/bin/calvaria ] && {
/usr/bin/calvaria -p -n bme -i last /dev/mtdblock1 >/lib/firmware/n810-cal-bme-pmm.fw ||\
echo "CAL-BME extract: Failed to extract blob"
}
}
[ "$FIRMWARE" = "n810-cal-bme-pmm.fw" ] && {
[ -z "$(grep -e 'Nokia N810' /proc/cpuinfo)" ] || {
[ -e /lib/firmware/n810-cal-bme-pmm.fw ] ||\
n810_cal_bme_pmm_extract
}
}
#!/bin/sh
p54spi_eeprom_clean() {
rm -f /tmp/wlan-iq-align /tmp/wlan-tx-gen2
}
p54spi_eeprom_die() {
echo "$*"
p54spi_eeprom_clean
exit 1
}
p54spi_eeprom_extract() {
[ -x /usr/bin/calvaria -a -x /usr/bin/cal2p54 ] && {
/usr/bin/calvaria -p -n wlan-iq-align -i last /dev/mtdblock1 >/tmp/wlan-iq-align ||\
p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-iq-align"
/usr/bin/calvaria -p -n wlan-tx-gen2 -i last /dev/mtdblock1 >/tmp/wlan-tx-gen2 ||\
p54spi_eeprom_die "p54spi EEPROM: Failed to extract wlan-tx-gen2"
/usr/bin/cal2p54 /tmp/wlan-tx-gen2 /tmp/wlan-iq-align >/lib/firmware/3826.eeprom ||\
p54spi_eeprom_die "p54spi EEPROM: Failed to generate EEPROM"
p54spi_eeprom_clean
}
}
[ "$FIRMWARE" = "3826.eeprom" ] && {
[ -z "$(grep -e 'Nokia N810' /proc/cpuinfo)" ] || {
[ -e /lib/firmware/3826.eeprom ] ||\
p54spi_eeprom_extract
}
}
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2010 OpenWrt.org
START=25
start() {
[ -c /dev/watchdog -a -x /sbin/watchdog ] || {
echo "WARNING: Watchdog not available. System will reboot soon!"
return 1
}
/sbin/watchdog -T 63 -t 50 /dev/watchdog
[ -x /usr/bin/schedtool ] && /usr/bin/schedtool -R -p 60 -n -20 $(pidof watchdog)
}
stop() {
killall -q watchdog
}
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
tts/0::askfirst:/bin/ash --login
ttyO2::askfirst:/bin/ash --login
tty1::askfirst:/bin/ash --login
14706 -12 -3754952 36 -9898 35656000 65536
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
NAND_BLOCKSIZE=2048-128k
define Image/BuildKernel
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-zImage
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(BIN_DIR)/$(IMG_PREFIX)-root.$(1))
endef
define Image/Build
$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-root.$(1)
$(call Image/Build/$(1),$(1))
endef
$(eval $(call BuildImage))
#
# Copyright (C) 2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define KernelPackage/sound-soc-omap
TITLE:=OMAP SoC sound support
KCONFIG:= \
CONFIG_SND_OMAP_SOC
FILES:=$(LINUX_DIR)/sound/soc/omap/snd-soc-omap.ko
AUTOLOAD:=$(call AutoLoad,60,snd-soc-omap)
DEPENDS:=@TARGET_omap24xx +kmod-sound-soc-core
$(call AddDepends/sound)
endef
$(eval $(call KernelPackage,sound-soc-omap))
define KernelPackage/sound-soc-omap-mcbsp
TITLE:=OMAP SoC MCBSP support
KCONFIG:= \
CONFIG_SND_OMAP_SOC_MCBSP
FILES:=$(LINUX_DIR)/sound/soc/omap/snd-soc-omap-mcbsp.ko
AUTOLOAD:=$(call AutoLoad,61,snd-soc-omap-mcbsp)
DEPENDS:=@TARGET_omap24xx +kmod-sound-soc-omap
$(call AddDepends/sound)
endef
$(eval $(call KernelPackage,sound-soc-omap-mcbsp))
define KernelPackage/sound-soc-n810
TITLE:=Nokia n810 SoC sound support
KCONFIG:= \
CONFIG_SND_OMAP_SOC_N810
FILES:= \
$(LINUX_DIR)/sound/soc/codecs/snd-soc-tlv320aic3x.ko \
$(LINUX_DIR)/sound/soc/omap/snd-soc-n810.ko
AUTOLOAD:=$(call AutoLoad,65,snd-soc-tlv320aic3x snd-soc-n810)
DEPENDS:=@TARGET_omap24xx +kmod-sound-soc-omap +kmod-sound-soc-omap-mcbsp
$(call AddDepends/sound)
endef
$(eval $(call KernelPackage,sound-soc-n810))
define KernelPackage/n810bm
SUBMENU:=$(OTHER_MENU)
TITLE:=Nokia N810 battery management driver
DEPENDS:=@TARGET_omap24xx
KCONFIG:=CONFIG_N810BM
FILES:=$(LINUX_DIR)/drivers/cbus/n810bm.ko
AUTOLOAD:=$(call AutoLoad,01,n810bm)
endef
define KernelPackage/n810bm/description
Nokia N810 battery management driver.
Controls battery power management and battery charging.
endef
$(eval $(call KernelPackage,n810bm))
define KernelPackage/usb-tahvo
TITLE:=Support for Tahvo (Nokia n810) USB
KCONFIG:= \
CONFIG_TAHVO_USB \
CONFIG_TAHVO_USB_HOST_BY_DEFAULT=n \
CONFIG_USB_OHCI_HCD_OMAP1=y \
CONFIG_USB_GADGET_DEBUG_FS=n
DEPENDS:=@TARGET_omap24xx +kmod-usb-musb-tusb6010
FILES:=$(LINUX_DIR)/drivers/usb/phy/phy-tahvo.ko
AUTOLOAD:=$(call AutoLoad,45,phy-tahvo)
$(call AddDepends/usb)
endef
define KernelPackage/usb-tahvo/description
Kernel support for Nokia n810 USB OHCI controller.
endef
$(eval $(call KernelPackage,usb-tahvo))
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -104,7 +104,9 @@ void tahvo_write_reg(struct device *chil
{
struct tahvo *tahvo = dev_get_drvdata(child->parent);
+ mutex_lock(&tahvo->mutex);
__tahvo_write_reg(tahvo, reg, val);
+ mutex_unlock(&tahvo->mutex);
}
EXPORT_SYMBOL(tahvo_write_reg);
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -53,9 +53,6 @@ struct retu {
int irq;
- int ack;
- bool ack_pending;
-
int mask;
bool mask_pending;
@@ -191,9 +188,10 @@ static irqreturn_t retu_irq_handler(int
mutex_lock(&retu->mutex);
idr = __retu_read_reg(retu, RETU_REG_IDR);
imr = __retu_read_reg(retu, RETU_REG_IMR);
+ idr &= ~imr;
+ __retu_write_reg(retu, RETU_REG_IDR, idr);
mutex_unlock(&retu->mutex);
- idr &= ~imr;
if (!idr) {
dev_vdbg(retu->dev, "No IRQ, spurious?\n");
return IRQ_NONE;
@@ -232,15 +230,6 @@ static void retu_irq_unmask(struct irq_d
}
-static void retu_irq_ack(struct irq_data *data)
-{
- struct retu *retu = irq_data_get_irq_chip_data(data);
- int irq = data->irq;
-
- retu->ack |= (1 << (irq - retu->irq_base));
- retu->ack_pending = true;
-}
-
static void retu_bus_lock(struct irq_data *data)
{
struct retu *retu = irq_data_get_irq_chip_data(data);
@@ -257,11 +246,6 @@ static void retu_bus_sync_unlock(struct
retu->mask_pending = false;
}
- if (retu->ack_pending) {
- __retu_write_reg(retu, RETU_REG_IDR, retu->ack);
- retu->ack_pending = false;
- }
-
mutex_unlock(&retu->mutex);
}
@@ -271,7 +255,6 @@ static struct irq_chip retu_irq_chip = {
.irq_bus_sync_unlock = retu_bus_sync_unlock,
.irq_mask = retu_irq_mask,
.irq_unmask = retu_irq_unmask,
- .irq_ack = retu_irq_ack,
};
static inline void retu_irq_setup(int irq)
@@ -291,8 +274,7 @@ static void retu_irq_init(struct retu *r
for (irq = base; irq < end; irq++) {
irq_set_chip_data(irq, retu);
- irq_set_chip_and_handler(irq, &retu_irq_chip,
- handle_simple_irq);
+ irq_set_chip(irq, &retu_irq_chip);
irq_set_nested_thread(irq, 1);
retu_irq_setup(irq);
}
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -48,11 +48,9 @@ struct tahvo {
int irq_end;
int irq;
- int ack;
int mask;
unsigned int mask_pending:1;
- unsigned int ack_pending:1;
unsigned int is_betty:1;
};
@@ -138,9 +136,12 @@ static irqreturn_t tahvo_irq_handler(int
u16 id;
u16 im;
+ mutex_lock(&tahvo->mutex);
id = __tahvo_read_reg(tahvo, TAHVO_REG_IDR);
im = __tahvo_read_reg(tahvo, TAHVO_REG_IMR);
id &= ~im;
+ __tahvo_write_reg(tahvo, TAHVO_REG_IDR, id);
+ mutex_unlock(&tahvo->mutex);
if (!id) {
dev_vdbg(tahvo->dev, "No IRQ, spurious ?\n");
@@ -177,11 +178,6 @@ static void tahvo_irq_bus_sync_unlock(st
tahvo->mask_pending = false;
}
- if (tahvo->ack_pending) {
- __tahvo_write_reg(tahvo, TAHVO_REG_IDR, tahvo->ack);
- tahvo->ack_pending = false;
- }
-
mutex_unlock(&tahvo->mutex);
}
@@ -203,22 +199,12 @@ static void tahvo_irq_unmask(struct irq_
tahvo->mask_pending = true;
}
-static void tahvo_irq_ack(struct irq_data *data)
-{
- struct tahvo *tahvo = irq_data_get_irq_chip_data(data);
- int irq = data->irq;
-
- tahvo->ack |= (1 << (irq - tahvo->irq_base));
- tahvo->ack_pending = true;
-}
-
static struct irq_chip tahvo_irq_chip = {
.name = "tahvo",
.irq_bus_lock = tahvo_irq_bus_lock,
.irq_bus_sync_unlock = tahvo_irq_bus_sync_unlock,
.irq_mask = tahvo_irq_mask,
.irq_unmask = tahvo_irq_unmask,
- .irq_ack = tahvo_irq_ack,
};
static inline void tahvo_irq_setup(int irq)
@@ -238,8 +224,7 @@ static void tahvo_irq_init(struct tahvo
for (irq = base; irq < end; irq++) {
irq_set_chip_data(irq, tahvo);
- irq_set_chip_and_handler(irq, &tahvo_irq_chip,
- handle_simple_irq);
+ irq_set_chip(irq, &tahvo_irq_chip);
irq_set_nested_thread(irq, 1);
tahvo_irq_setup(irq);
}
--- a/drivers/cbus/retu.c
+++ b/drivers/cbus/retu.c
@@ -451,7 +451,8 @@ static int __devinit retu_probe(struct p
(rev >> 4) & 0x07, rev & 0x0f);
/* Mask all RETU interrupts */
- __retu_write_reg(retu, RETU_REG_IMR, 0xffff);
+ retu->mask = 0xFFFF;
+ __retu_write_reg(retu, RETU_REG_IMR, retu->mask);
ret = request_threaded_irq(retu->irq, NULL, retu_irq_handler,
IRQF_ONESHOT, "retu", retu);
--- a/drivers/cbus/tahvo.c
+++ b/drivers/cbus/tahvo.c
@@ -346,7 +346,8 @@ static int __devinit tahvo_probe(struct
(rev >> 4) & 0x0f, rev & 0x0f);
/* Mask all TAHVO interrupts */
- __tahvo_write_reg(tahvo, TAHVO_REG_IMR, 0xffff);
+ tahvo->mask = 0xFFFF;
+ __tahvo_write_reg(tahvo, TAHVO_REG_IMR, tahvo->mask);
ret = request_threaded_irq(irq, NULL, tahvo_irq_handler,
IRQF_TRIGGER_RISING | IRQF_ONESHOT,
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -15,8 +15,11 @@
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/init.h>
+#include <linux/irq.h>
#include <linux/io.h>
#include <linux/stddef.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/cbus.h>
#include <linux/i2c.h>
#include <linux/spi/spi.h>
#include <linux/usb/musb.h>
@@ -193,6 +196,110 @@ static struct omap_onenand_platform_data
};
#endif
+#if defined(CONFIG_CBUS) || defined(CONFIG_CBUS_MODULE)
+
+static struct cbus_host_platform_data n8x0_cbus_data = {
+ .clk_gpio = 66,
+ .dat_gpio = 65,
+ .sel_gpio = 64,
+};
+
+static struct platform_device n8x0_cbus_device = {
+ .name = "cbus",
+ .id = -1,
+ .dev = {
+ .platform_data = &n8x0_cbus_data,
+ },
+};
+
+static struct resource retu_resource[] = {
+ {
+ .start = -EINVAL, /* set later */
+ .flags = IORESOURCE_IRQ,
+ },
+};
+
+static struct cbus_retu_platform_data n8x0_retu_data = {
+ .devid = CBUS_RETU_DEVICE_ID,
+};
+
+static struct platform_device retu_device = {
+ .name = "retu",
+ .id = -1,
+ .resource = retu_resource,
+ .num_resources = ARRAY_SIZE(retu_resource),
+ .dev = {
+ .platform_data = &n8x0_retu_data,
+ .parent = &n8x0_cbus_device.dev,
+ },
+};
+
+static struct resource tahvo_resource[] = {
+ {
+ .start = -EINVAL, /* set later */
+ .flags = IORESOURCE_IRQ,
+ }
+};
+
+static struct platform_device tahvo_device = {
+ .name = "tahvo",
+ .id = -1,
+ .resource = tahvo_resource,
+ .num_resources = ARRAY_SIZE(tahvo_resource),
+ .dev = {
+ .parent = &n8x0_cbus_device.dev,
+ },
+};
+
+static void __init n8x0_cbus_init(void)
+{
+ int ret;
+
+ platform_device_register(&n8x0_cbus_device);
+
+ ret = gpio_request(108, "RETU irq");
+ if (ret < 0) {
+ pr_err("retu: Unable to reserve IRQ GPIO\n");
+ return;
+ }
+
+ ret = gpio_direction_input(108);
+ if (ret < 0) {
+ pr_err("retu: Unable to change gpio direction\n");
+ gpio_free(108);
+ return;
+ }
+
+ irq_set_irq_type(gpio_to_irq(108), IRQ_TYPE_EDGE_RISING);
+ retu_resource[0].start = gpio_to_irq(108);
+ platform_device_register(&retu_device);
+
+ ret = gpio_request(111, "TAHVO irq");
+ if (ret) {
+ pr_err("tahvo: Unable to reserve IRQ GPIO\n");
+ gpio_free(108);
+ return;
+ }
+
+ /* Set the pin as input */
+ ret = gpio_direction_input(111);
+ if (ret) {
+ pr_err("tahvo: Unable to change direction\n");
+ gpio_free(108);
+ gpio_free(111);
+ return;
+ }
+
+ tahvo_resource[0].start = gpio_to_irq(111);
+ platform_device_register(&tahvo_device);
+}
+
+#else
+static inline void __init n8x0_cbus_init(void)
+{
+}
+#endif
+
#if defined(CONFIG_MENELAUS) && \
(defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
@@ -671,6 +778,8 @@ static inline void board_serial_init(voi
static void __init n8x0_init_machine(void)
{
omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
+ n8x0_cbus_init();
+
/* FIXME: add n810 spi devices */
spi_register_board_info(n800_spi_board_info,
ARRAY_SIZE(n800_spi_board_info));
--- /dev/null
+++ b/include/linux/platform_data/cbus.h
@@ -0,0 +1,38 @@
+/*
+ * cbus.h - CBUS platform_data definition
+ *
+ * Copyright (C) 2004 - 2009 Nokia Corporation
+ *
+ * Written by Felipe Balbi <felipe.balbi@nokia.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file "COPYING" in the main directory of this
+ * archive for more details.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __INCLUDE_LINUX_CBUS_H
+#define __INCLUDE_LINUX_CBUS_H
+
+#define CBUS_RETU_DEVICE_ID 0x01
+#define CBUS_TAHVO_DEVICE_ID 0x02
+
+struct cbus_host_platform_data {
+ int dat_gpio;
+ int clk_gpio;
+ int sel_gpio;
+};
+
+struct cbus_retu_platform_data {
+ int devid;
+};
+
+#endif /* __INCLUDE_LINUX_CBUS_H */
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -420,10 +420,10 @@ static void set_fb_fix(struct fb_info *f
fbi->screen_base = rg->vaddr;
if (!from_init) {
- mutex_lock(&fbi->mm_lock);
+ preempt_disable();
fix->smem_start = rg->paddr;
fix->smem_len = rg->size;
- mutex_unlock(&fbi->mm_lock);
+ preempt_enable();
} else {
fix->smem_start = rg->paddr;
fix->smem_len = rg->size;
@@ -933,10 +933,10 @@ static int omapfb_setup_mem(struct fb_in
* plane memory is dealloce'd, the other
* screen parameters in var / fix are invalid.
*/
- mutex_lock(&fbi->mm_lock);
+ preempt_disable();
fbi->fix.smem_start = 0;
fbi->fix.smem_len = 0;
- mutex_unlock(&fbi->mm_lock);
+ preempt_enable();
}
}
}
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1383,8 +1383,10 @@ fb_mmap(struct file *file, struct vm_are
}
/* frame buffer memory */
+ preempt_disable();
start = info->fix.smem_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
+ preempt_enable();
if (off >= len) {
/* memory mapped io */
off -= len;
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -923,14 +923,14 @@ static int get_dss_clocks(void)
return PTR_ERR(dispc.dss_ick);
}
- dispc.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "fck");
+ dispc.dss1_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss1_fck");
if (IS_ERR(dispc.dss1_fck)) {
dev_err(dispc.fbdev->dev, "can't get dss1_fck\n");
clk_put(dispc.dss_ick);
return PTR_ERR(dispc.dss1_fck);
}
- dispc.dss_54m_fck = clk_get(&dispc.fbdev->dssdev->dev, "tv_clk");
+ dispc.dss_54m_fck = clk_get(&dispc.fbdev->dssdev->dev, "dss_54m_fck");
if (IS_ERR(dispc.dss_54m_fck)) {
dev_err(dispc.fbdev->dev, "can't get tv_fck\n");
clk_put(dispc.dss_ick);
--- a/drivers/video/omap/rfbi.c
+++ b/drivers/video/omap/rfbi.c
@@ -90,7 +90,7 @@ static int rfbi_get_clocks(void)
return PTR_ERR(rfbi.dss_ick);
}
- rfbi.dss1_fck = clk_get(&rfbi.fbdev->dssdev->dev, "fck");
+ rfbi.dss1_fck = clk_get(&rfbi.fbdev->dssdev->dev, "dss1_fck");
if (IS_ERR(rfbi.dss1_fck)) {
dev_err(rfbi.fbdev->dev, "can't get dss1_fck\n");
clk_put(rfbi.dss_ick);
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -146,6 +146,8 @@
#include <plat/omap_hwmod.h>
#include <plat/prcm.h>
+#include <asm/mach-types.h>
+
#include "cm2xxx_3xxx.h"
#include "cminst44xx.h"
#include "prm2xxx_3xxx.h"
@@ -1769,6 +1771,16 @@ static int _setup(struct omap_hwmod *oh,
oh->_state = _HWMOD_STATE_INITIALIZED;
+ if (machine_is_nokia770() ||
+ machine_is_nokia_n800() ||
+ machine_is_nokia_n810() ||
+ machine_is_nokia_n810_wimax()) {
+ /* Nokia N-series workaround: Don't reset any hwmod. Some drivers expect
+ * the NOLO bootloader initializations to be effective. */
+ oh->flags |= HWMOD_INIT_NO_RESET;
+ printk_once(KERN_INFO "Nokia N-series HWMOD_INIT_NO_RESET workaround enabled\n");
+ }
+
/*
* In the case of hwmod with hardreset that should not be
* de-assert at boot time, we have to keep the module
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -25,6 +25,8 @@
#include <linux/usb/musb.h>
#include <sound/tlv320aic3x.h>
#include <linux/spi/tsc2005.h>
+#include <linux/input.h>
+#include <linux/i2c/lm8323.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
@@ -37,6 +39,7 @@
#include <plat/onenand.h>
#include <plat/mmc.h>
#include <plat/serial.h>
+#include <plat/gpio-switch.h>
#include "mux.h"
@@ -104,6 +107,152 @@ extern struct mipid_platform_data n8x0_m
extern void n8x0_mipid_init(void);
extern void n8x0_blizzard_init(void);
+/* We map the FN key as LALT to workaround an X keycode problem.
+ * The XKB map needs to be adjusted to support this. */
+#define MAP_FN_AS_LEFTALT
+
+static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
+ [0x01] = KEY_Q,
+ [0x02] = KEY_K,
+ [0x03] = KEY_O,
+ [0x04] = KEY_P,
+ [0x05] = KEY_BACKSPACE,
+ [0x06] = KEY_A,
+ [0x07] = KEY_S,
+ [0x08] = KEY_D,
+ [0x09] = KEY_F,
+ [0x0a] = KEY_G,
+ [0x0b] = KEY_H,
+ [0x0c] = KEY_J,
+
+ [0x11] = KEY_W,
+ [0x12] = KEY_F4,
+ [0x13] = KEY_L,
+ [0x14] = KEY_APOSTROPHE,
+ [0x16] = KEY_Z,
+ [0x17] = KEY_X,
+ [0x18] = KEY_C,
+ [0x19] = KEY_V,
+ [0x1a] = KEY_B,
+ [0x1b] = KEY_N,
+ [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
+ [0x1f] = KEY_F7,
+
+ [0x21] = KEY_E,
+ [0x22] = KEY_SEMICOLON,
+ [0x23] = KEY_MINUS,
+ [0x24] = KEY_EQUAL,
+#ifdef MAP_FN_AS_LEFTALT
+ [0x2b] = KEY_LEFTALT,
+#else
+ [0x2b] = KEY_FN,
+#endif
+ [0x2c] = KEY_M,
+ [0x2f] = KEY_F8,
+
+ [0x31] = KEY_R,
+ [0x32] = KEY_RIGHTCTRL,
+ [0x34] = KEY_SPACE,
+ [0x35] = KEY_COMMA,
+ [0x37] = KEY_UP,
+ [0x3c] = KEY_COMPOSE,
+ [0x3f] = KEY_F6,
+
+ [0x41] = KEY_T,
+ [0x44] = KEY_DOT,
+ [0x46] = KEY_RIGHT,
+ [0x4f] = KEY_F5,
+ [0x51] = KEY_Y,
+ [0x53] = KEY_DOWN,
+ [0x55] = KEY_ENTER,
+ [0x5f] = KEY_ESC,
+
+ [0x61] = KEY_U,
+ [0x64] = KEY_LEFT,
+
+ [0x71] = KEY_I,
+ [0x75] = KEY_KPENTER,
+};
+
+static struct lm8323_platform_data lm8323_pdata = {
+ .repeat = 0, /* Repeat is handled in userspace for now. */
+ .keymap = rx44_keymap,
+ .size_x = 8,
+ .size_y = 12,
+ .debounce_time = 12,
+ .active_time = 500,
+
+ .name = "Internal keyboard",
+ .pwm_names[0] = "n810::keyboard",
+ .pwm_names[1] = "n810::cover",
+};
+
+#define OMAP_TAG_NOKIA_BT 0x4e01
+
+struct omap_bluetooth_config {
+ u8 chip_type;
+ u8 bt_wakeup_gpio;
+ u8 host_wakeup_gpio;
+ u8 reset_gpio;
+ u8 bt_uart;
+ u8 bd_addr[6];
+ u8 bt_sysclk;
+};
+
+static struct platform_device n8x0_bt_device = {
+ .name = "hci_h4p",
+ .id = -1,
+ .num_resources = 0,
+};
+
+void __init n8x0_bt_init(void)
+{
+ const struct omap_bluetooth_config *bt_config;
+
+ bt_config = (void *) omap_get_config(OMAP_TAG_NOKIA_BT,
+ struct omap_bluetooth_config);
+ n8x0_bt_device.dev.platform_data = (void *) bt_config;
+ if (platform_device_register(&n8x0_bt_device) < 0)
+ BUG();
+}
+
+static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
+ {
+ .name = "headphone",
+ .gpio = -1,
+ .debounce_rising = 200,
+ .debounce_falling = 200,
+ }, {
+ .name = "cam_act",
+ .gpio = -1,
+ .debounce_rising = 200,
+ .debounce_falling = 200,
+ }, {
+ .name = "cam_turn",
+ .gpio = -1,
+ .debounce_rising = 100,
+ .debounce_falling = 100,
+ }, {
+ .name = "slide",
+ .gpio = -1,
+ .debounce_rising = 200,
+ .debounce_falling = 200,
+ }, {
+ .name = "kb_lock",
+ .gpio = -1,
+ .debounce_rising = 200,
+ .debounce_falling = 200,
+ },
+};
+
+static void __init n8x0_gpio_switches_init(void)
+{
+ /* The switches are actually registered through ATAG mechanism.
+ * This just updates the parameters (thus .gpio is -1) */
+ omap_register_gpio_switches(n8x0_gpio_switches,
+ ARRAY_SIZE(n8x0_gpio_switches));
+}
+
#define TUSB6010_ASYNC_CS 1
#define TUSB6010_SYNC_CS 4
#define TUSB6010_GPIO_INT 58
@@ -799,6 +948,11 @@ static struct aic3x_pdata n810_aic33_dat
};
static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
+ {
+ I2C_BOARD_INFO("lm8323", 0x45),
+ .irq = OMAP_GPIO_IRQ(109),
+ .platform_data = &lm8323_pdata,
+ },
{
I2C_BOARD_INFO("tlv320aic3x", 0x18),
.platform_data = &n810_aic33_data,
@@ -856,7 +1010,9 @@ static inline void board_serial_init(voi
static void __init n8x0_init_machine(void)
{
omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
+ n8x0_gpio_switches_init();
n8x0_cbus_init();
+ n8x0_bt_init();
/* FIXME: add n810 spi devices */
tsc2005_set_config();
From f0bb9e67f0f13021e5033fed3dfe8ef78fe6a538 Mon Sep 17 00:00:00 2001
From: Marat Radchenko <marat@slonopotamus.org>
Date: Tue, 18 Oct 2011 21:52:56 +0400
Subject: [PATCH 2/2] N800: add TSC2301 board info
This patch adds TSC2301 init logic to N800 board file
---
arch/arm/mach-omap2/board-n8x0.c | 141 ++++++++++++++++++++++++++++++++++++--
1 files changed, 135 insertions(+), 6 deletions(-)
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -27,6 +27,7 @@
#include <linux/spi/tsc2005.h>
#include <linux/input.h>
#include <linux/i2c/lm8323.h>
+#include <linux/spi/tsc2301.h>
#include <asm/mach/arch.h>
#include <asm/mach-types.h>
@@ -63,7 +64,75 @@ static struct omap2_mcspi_device_config
};
#endif
-static void __init tsc2005_set_config(void)
+#ifdef CONFIG_TOUCHSCREEN_TSC2301
+
+#define N800_KEYB_IRQ_GPIO 109
+
+static struct tsc2301_platform_data tsc2301_config = {
+ .reset_gpio = 118,
+ .keymap = {
+ -1, /* Event for bit 0 */
+ KEY_UP, /* Event for bit 1 (up) */
+ KEY_F5, /* Event for bit 2 (home) */
+ -1, /* Event for bit 3 */
+ KEY_LEFT, /* Event for bit 4 (left) */
+ KEY_ENTER, /* Event for bit 5 (enter) */
+ KEY_RIGHT, /* Event for bit 6 (right) */
+ -1, /* Event for bit 7 */
+ KEY_ESC, /* Event for bit 8 (cycle) */
+ KEY_DOWN, /* Event for bit 9 (down) */
+ KEY_F4, /* Event for bit 10 (menu) */
+ -1, /* Event for bit 11 */
+ KEY_F8, /* Event for bit 12 (Zoom-) */
+ KEY_F6, /* Event for bit 13 (FS) */
+ KEY_F7, /* Event for bit 14 (Zoom+) */
+ -1, /* Event for bit 15 */
+ },
+ .kp_rep = 0,
+ .keyb_name = "Internal keypad",
+};
+
+static struct omap2_mcspi_device_config tsc2301_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1,
+};
+
+/*
+ TODO(Marat Radchenko): better pass GPIO to tsc2301 driver and let it
+ allocate irq itself (as it is already done for touchscreen)
+ */
+static void tsc2301_dev_init(void)
+{
+ int r;
+ int gpio = N800_KEYB_IRQ_GPIO;
+
+ r = gpio_request(gpio, "tsc2301 KBD IRQ");
+ if (r >= 0) {
+ gpio_direction_input(gpio);
+ tsc2301_config.keyb_int = gpio_to_irq(gpio);
+ } else {
+ printk(KERN_ERR "unable to get KBD GPIO");
+ }
+
+ gpio = 103;
+ r = gpio_request(gpio, "tsc2301 DAV IRQ");
+ if (r >= 0) {
+ gpio_direction_input(gpio);
+ tsc2301_config.dav_int = gpio_to_irq(gpio);
+ } else {
+ printk(KERN_ERR "unable to get DAV GPIO");
+ }
+}
+
+#else
+
+static void __init tsc2301_dev_init(void)
+{
+}
+
+#endif
+
+static void __init n8x0_ts_set_config(void)
{
const struct omap_lcd_config *conf;
@@ -94,6 +163,37 @@ static void __init tsc2005_set_config(vo
tsc2005_config.ts_x_plate_ohm = 200;
}
#endif
+
+#ifdef CONFIG_TOUCHSCREEN_TSC2301
+ if (strcmp(conf->panel_name, "lph8923") == 0) {
+ tsc2301_config.ts_x_plate_ohm = 180;
+ tsc2301_config.ts_hw_avg = 8;
+ tsc2301_config.ts_max_pressure = 2048;
+ tsc2301_config.ts_touch_pressure = 400;
+ tsc2301_config.ts_stab_time = 100;
+ tsc2301_config.ts_pressure_fudge = 2;
+ tsc2301_config.ts_x_max = 4096;
+ tsc2301_config.ts_x_fudge = 4;
+ tsc2301_config.ts_y_max = 4096;
+ tsc2301_config.ts_y_fudge = 7;
+ } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
+ tsc2301_config.ts_x_plate_ohm = 280;
+ tsc2301_config.ts_hw_avg = 8;
+ tsc2301_config.ts_touch_pressure = 400;
+ tsc2301_config.ts_max_pressure = 2048;
+ tsc2301_config.ts_stab_time = 1000;
+ tsc2301_config.ts_pressure_fudge = 2;
+ tsc2301_config.ts_x_max = 4096;
+ tsc2301_config.ts_x_fudge = 4;
+ tsc2301_config.ts_y_max = 4096;
+ tsc2301_config.ts_y_fudge = 7;
+ } else {
+ printk(KERN_ERR "Unknown panel type, set default "
+ "touchscreen configuration\n");
+ tsc2301_config.ts_x_plate_ohm = 200;
+ tsc2301_config.ts_stab_time = 100;
+ }
+#endif
}
}
@@ -347,13 +447,12 @@ static void __init n8x0_usb_init(void) {
#endif /*CONFIG_USB_MUSB_TUSB6010 */
-
static struct omap2_mcspi_device_config p54spi_mcspi_config = {
.turbo_mode = 0,
.single_channel = 1,
};
-static struct spi_board_info n800_spi_board_info[] __initdata = {
+static struct spi_board_info n8x0_common_spi_board_info[] __initdata = {
{
.modalias = "lcd_mipid",
.bus_num = 1,
@@ -369,6 +468,10 @@ static struct spi_board_info n800_spi_bo
.max_speed_hz = 48000000,
.controller_data = &p54spi_mcspi_config,
},
+};
+
+static struct spi_board_info n810_spi_board_info[] __initdata = {
+#ifdef CONFIG_TOUCHSCREEN_TSC2005
{
.modalias = "tsc2005",
.bus_num = 1,
@@ -378,6 +481,20 @@ static struct spi_board_info n800_spi_bo
.controller_data = &tsc2005_mcspi_config,
.platform_data = &tsc2005_config,
},
+#endif
+};
+
+static struct spi_board_info n800_spi_board_info[] __initdata = {
+#if defined(CONFIG_TOUCHSCREEN_TSC2301)
+ {
+ .modalias = "tsc2301",
+ .bus_num = 1,
+ .chip_select = 0,
+ .max_speed_hz = 6000000,
+ .controller_data = &tsc2301_mcspi_config,
+ .platform_data = &tsc2301_config,
+ },
+#endif
};
#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
@@ -1015,9 +1132,17 @@ static void __init n8x0_init_machine(voi
n8x0_bt_init();
/* FIXME: add n810 spi devices */
- tsc2005_set_config();
- spi_register_board_info(n800_spi_board_info,
- ARRAY_SIZE(n800_spi_board_info));
+ n8x0_ts_set_config();
+
+ spi_register_board_info(n8x0_common_spi_board_info,
+ ARRAY_SIZE(n8x0_common_spi_board_info));
+ if (machine_is_nokia_n800())
+ spi_register_board_info(n800_spi_board_info,
+ ARRAY_SIZE(n800_spi_board_info));
+ else
+ spi_register_board_info(n810_spi_board_info,
+ ARRAY_SIZE(n810_spi_board_info));
+
omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
ARRAY_SIZE(n8x0_i2c_board_info_1));
omap_register_i2c_bus(2, 400, NULL, 0);
@@ -1027,6 +1152,8 @@ static void __init n8x0_init_machine(voi
board_serial_init();
n8x0_mipid_init();
n8x0_blizzard_init();
+ if (machine_is_nokia_n800())
+ tsc2301_dev_init();
omap_sdrc_init(NULL, NULL);
gpmc_onenand_init(board_onenand_data);
n8x0_mmc_init();
---
arch/arm/mach-omap2/board-n8x0.c | 73 +++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -316,6 +316,77 @@ void __init n8x0_bt_init(void)
BUG();
}
+struct gpio_switch_input_dev {
+ struct input_dev *idev;
+ unsigned int swcode;
+};
+
+static struct gpio_switch_input_dev *slide_input;
+static struct gpio_switch_input_dev *kblock_input;
+
+static void n8x0_gpio_switch_input_notify(struct gpio_switch_input_dev *gdev,
+ int state)
+{
+ if (gdev) {
+ input_report_switch(gdev->idev, gdev->swcode, state);
+ input_sync(gdev->idev);
+ }
+}
+
+static void n8x0_slide_notify(void *data, int state)
+{
+ n8x0_gpio_switch_input_notify(slide_input, state);
+}
+
+static void n8x0_kb_lock_notify(void *data, int state)
+{
+ n8x0_gpio_switch_input_notify(kblock_input, state);
+}
+
+static struct gpio_switch_input_dev * __init gpioswitch_input_init(
+ const char *name,
+ unsigned int swcode)
+{
+ struct gpio_switch_input_dev *gdev;
+ int err;
+
+ gdev = kzalloc(sizeof(*gdev), GFP_KERNEL);
+ if (!gdev)
+ goto error;
+ gdev->swcode = swcode;
+
+ gdev->idev = input_allocate_device();
+ if (!gdev->idev)
+ goto err_free;
+
+ gdev->idev->evbit[0] = BIT_MASK(EV_SW);
+ gdev->idev->swbit[BIT_WORD(swcode)] = BIT_MASK(swcode);
+ gdev->idev->name = name;
+
+ err = input_register_device(gdev->idev);
+ if (err)
+ goto err_free_idev;
+
+ return gdev;
+
+err_free_idev:
+ input_free_device(gdev->idev);
+err_free:
+ kfree(gdev);
+error:
+ return NULL;
+}
+
+static int __init n8x0_gpio_switches_input_init(void)
+{
+ slide_input = gpioswitch_input_init("slide", SW_KEYPAD_SLIDE);
+ kblock_input = gpioswitch_input_init("kb_lock", SW_LID);
+ if (WARN_ON(!slide_input || !kblock_input))
+ return -ENODEV;
+ return 0;
+}
+late_initcall(n8x0_gpio_switches_input_init);
+
static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
{
.name = "headphone",
@@ -337,11 +408,13 @@ static struct omap_gpio_switch n8x0_gpio
.gpio = -1,
.debounce_rising = 200,
.debounce_falling = 200,
+ .notify = n8x0_slide_notify,
}, {
.name = "kb_lock",
.gpio = -1,
.debounce_rising = 200,
.debounce_falling = 200,
+ .notify = n8x0_kb_lock_notify,
},
};
--- a/drivers/bluetooth/hci_h4p/core.c
+++ b/drivers/bluetooth/hci_h4p/core.c
@@ -36,9 +36,9 @@
#include <linux/clk.h>
#include <linux/gpio.h>
-#include <mach/hardware.h>
-#include <mach/board.h>
-#include <mach/irqs.h>
+#include <plat/hardware.h>
+#include <plat/board.h>
+#include <plat/irqs.h>
#include <plat/serial.h>
#include <net/bluetooth/bluetooth.h>
--- a/drivers/bluetooth/hci_h4p/hci_h4p.h
+++ b/drivers/bluetooth/hci_h4p/hci_h4p.h
@@ -21,7 +21,7 @@
*
*/
-#include <mach/board.h>
+#include <plat/board.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
--- a/drivers/bluetooth/hci_h4p/sysfs.c
+++ b/drivers/bluetooth/hci_h4p/sysfs.c
@@ -48,15 +48,8 @@ static ssize_t hci_h4p_store_bdaddr(stru
return -EINVAL;
}
- //for (i = 0; i < 6; i++)
- //info->bdaddr[i] = bdaddr[i] & 0xff;
-
- info->bdaddr[0] = 0x00;
- info->bdaddr[1] = 0x1D;
- info->bdaddr[2] = 0x6E;
- info->bdaddr[3] = 0xD4;
- info->bdaddr[4] = 0xF0;
- info->bdaddr[5] = 0x37;
+ for (i = 0; i < 6; i++)
+ info->bdaddr[i] = bdaddr[i] & 0xff;
return count;
}
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
@@ -235,7 +235,7 @@ struct omap_hwmod_irq_info omap2_timer11
};
struct omap_hwmod_irq_info omap2_uart1_mpu_irqs[] = {
- { .irq = INT_24XX_UART1_IRQ, },
+ { .irq = 0, },
{ .irq = -1 }
};
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -517,8 +517,10 @@ static int serial_omap_startup(struct ua
/*
* Allocate the IRQ
*/
- retval = request_irq(up->port.irq, serial_omap_irq, up->port.irqflags,
- up->name, up);
+ retval = 0;
+ if (up->port.irq)
+ retval = request_irq(up->port.irq, serial_omap_irq,
+ up->port.irqflags, up->name, up);
if (retval)
return retval;
@@ -629,7 +631,8 @@ static void serial_omap_shutdown(struct
}
pm_runtime_put(&up->pdev->dev);
- free_irq(up->port.irq, up);
+ if (up->port.irq)
+ free_irq(up->port.irq, up);
}
static inline void
--- a/arch/arm/mach-omap2/board-n8x0.c
+++ b/arch/arm/mach-omap2/board-n8x0.c
@@ -41,6 +41,7 @@
#include <plat/mmc.h>
#include <plat/serial.h>
#include <plat/gpio-switch.h>
+#include <plat/usb.h>
#include "mux.h"
@@ -486,6 +487,14 @@ static struct musb_hdrc_platform_data tu
.config = &musb_config,
};
+static struct omap_usb_config n8x0_omap_usb_config __initdata = {
+ .otg = 1,
+ .register_host = 1,
+ .register_dev = 1,
+ .hmc_mode = 16,
+ .pins[0] = 6,
+};
+
static void __init n8x0_usb_init(void)
{
int ret = 0;
@@ -507,6 +516,8 @@ static void __init n8x0_usb_init(void)
if (ret != 0)
goto err;
+ omap2_usbfs_init(&n8x0_omap_usb_config);
+
printk(announce);
return;
---
drivers/input/evdev.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -92,7 +92,7 @@ static void evdev_event(struct input_han
unsigned int type, unsigned int code, int value)
{
struct evdev *evdev = handle->private;
- struct evdev_client *client;
+ struct evdev_client *client, *c;
struct input_event event;
do_gettimeofday(&event.time);
@@ -103,9 +103,13 @@ static void evdev_event(struct input_han
rcu_read_lock();
client = rcu_dereference(evdev->grab);
- if (client)
+ if (client) {
evdev_pass_event(client, &event);
- else
+ /* Also pass events to clients that did not grab the device. */
+ list_for_each_entry_rcu(c, &evdev->client_list, node)
+ if (c != client)
+ evdev_pass_event(c, &event);
+ } else
list_for_each_entry_rcu(client, &evdev->client_list, node)
evdev_pass_event(client, &event);
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1456,6 +1456,7 @@ static int __init mmc_omap_probe(struct
host->dma_ch = -1;
host->irq = irq;
+ host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
host->phys_base = host->mem_res->start;
host->virt_base = ioremap(res->start, resource_size(res));
if (!host->virt_base)
@@ -1495,7 +1496,9 @@ static int __init mmc_omap_probe(struct
}
}
- host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
+ /* Make sure the detect workqueue was run at least once. */
+ printk(KERN_INFO "OMAP-mmc: waiting for cards...\n");
+ mmc_flush_scheduled_work();
return 0;
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -78,12 +78,13 @@ static int mmc_schedule_delayed_work(str
}
/*
- * Internal function. Flush all scheduled work from the MMC work queue.
+ * Flush all scheduled work from the MMC work queue.
*/
-static void mmc_flush_scheduled_work(void)
+void mmc_flush_scheduled_work(void)
{
flush_workqueue(workqueue);
}
+EXPORT_SYMBOL(mmc_flush_scheduled_work);
#ifdef CONFIG_FAIL_MMC_REQUEST
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -445,6 +445,8 @@ static inline int mmc_boot_partition_acc
return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
}
+void mmc_flush_scheduled_work(void);
+
#ifdef CONFIG_MMC_CLKGATE
void mmc_host_clk_hold(struct mmc_host *host);
void mmc_host_clk_release(struct mmc_host *host);
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -258,6 +258,8 @@ char *cmdline_find_option(char *str)
return strstr(saved_command_line, str);
}
+static struct omap_uart_state statebuf[4];
+
static int __init omap_serial_early_init(void)
{
do {
@@ -272,9 +274,9 @@ static int __init omap_serial_early_init
if (!oh)
break;
- uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL);
- if (WARN_ON(!uart))
+ if (WARN_ON(num_uarts >= ARRAY_SIZE(statebuf)))
return -ENODEV;
+ uart = &statebuf[num_uarts];
uart->oh = oh;
uart->num = num_uarts++;
--- a/drivers/usb/musb/tusb6010.c
+++ b/drivers/usb/musb/tusb6010.c
@@ -221,6 +221,7 @@ void musb_write_fifo(struct musb_hw_ep *
if (len > 0)
tusb_fifo_write_unaligned(fifo, buf, len);
}
+EXPORT_SYMBOL(musb_write_fifo);
void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *buf)
{
@@ -268,6 +269,7 @@ void musb_read_fifo(struct musb_hw_ep *h
if (len > 0)
tusb_fifo_read_unaligned(fifo, buf, len);
}
+EXPORT_SYMBOL(musb_read_fifo);
static struct musb *the_musb;
@@ -1165,7 +1167,7 @@ static const struct musb_platform_ops tu
static u64 tusb_dmamask = DMA_BIT_MASK(32);
-static int __init tusb_probe(struct platform_device *pdev)
+static int tusb_probe(struct platform_device *pdev)
{
struct musb_hdrc_platform_data *pdata = pdev->dev.platform_data;
struct platform_device *musb;
@@ -1245,18 +1247,18 @@ static struct platform_driver tusb_drive
},
};
-MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
-MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
-MODULE_LICENSE("GPL v2");
+//MODULE_DESCRIPTION("TUSB6010 MUSB Glue Layer");
+//MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
+//MODULE_LICENSE("GPL v2");
-static int __init tusb_init(void)
+int musb_hdrc_glue_init(void)
{
return platform_driver_probe(&tusb_driver, tusb_probe);
}
-subsys_initcall(tusb_init);
+EXPORT_SYMBOL(musb_hdrc_glue_init);
-static void __exit tusb_exit(void)
+void musb_hdrc_glue_exit(void)
{
platform_driver_unregister(&tusb_driver);
}
-module_exit(tusb_exit);
+EXPORT_SYMBOL(musb_hdrc_glue_exit);
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -207,7 +207,7 @@ static struct otg_io_access_ops musb_ulp
/*-------------------------------------------------------------------------*/
-#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_BLACKFIN)
+#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_TUSB6010_MODULE) && !defined(CONFIG_USB_MUSB_BLACKFIN)
/*
* Load an endpoint's FIFO
@@ -250,7 +250,7 @@ void musb_write_fifo(struct musb_hw_ep *
}
}
-#if !defined(CONFIG_USB_MUSB_AM35X)
+#if !defined(CONFIG_USB_MUSB_AM35X) && !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
/*
* Unload an endpoint's FIFO
*/
@@ -2370,8 +2370,13 @@ static struct platform_driver musb_drive
/*-------------------------------------------------------------------------*/
+extern int musb_hdrc_glue_init(void);
+extern void musb_hdrc_glue_exit(void);
+
static int __init musb_init(void)
{
+ int err;
+
if (usb_disabled())
return 0;
@@ -2380,7 +2385,17 @@ static int __init musb_init(void)
", "
"otg (peripheral+host)",
musb_driver_name);
- return platform_driver_probe(&musb_driver, musb_probe);
+
+ err = musb_hdrc_glue_init();
+ if (err)
+ return err;
+ err = platform_driver_probe(&musb_driver, musb_probe);
+ if (err) {
+ musb_hdrc_glue_exit();
+ return err;
+ }
+
+ return 0;
}
/* make us init after usbcore and i2c (transceivers, regulators, etc)
@@ -2391,5 +2406,6 @@ fs_initcall(musb_init);
static void __exit musb_cleanup(void)
{
platform_driver_unregister(&musb_driver);
+ musb_hdrc_glue_exit();
}
module_exit(musb_cleanup);
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -51,7 +51,7 @@ obj-$(CONFIG_EARLY_PRINTK_DBGP) += early
obj-$(CONFIG_USB_ATM) += atm/
obj-$(CONFIG_USB_SPEEDTOUCH) += atm/
-obj-$(CONFIG_USB_MUSB_HDRC) += musb/
+obj-y += musb/
obj-$(CONFIG_USB_RENESAS_USBHS) += renesas_usbhs/
obj-$(CONFIG_USB_GADGET) += gadget/
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -13,7 +13,7 @@ musb_hdrc-$(CONFIG_DEBUG_FS) += musb_d
# Hardware Glue Layer
obj-$(CONFIG_USB_MUSB_OMAP2PLUS) += omap2430.o
obj-$(CONFIG_USB_MUSB_AM35X) += am35x.o
-obj-$(CONFIG_USB_MUSB_TUSB6010) += tusb6010.o
+musb_hdrc-$(subst m,y,$(CONFIG_USB_MUSB_TUSB6010)) += tusb6010.o
obj-$(CONFIG_USB_MUSB_DAVINCI) += davinci.o
obj-$(CONFIG_USB_MUSB_DA8XX) += da8xx.o
obj-$(CONFIG_USB_MUSB_BLACKFIN) += blackfin.o
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -619,7 +619,7 @@ static void omap_device_delete(struct om
* information. Returns ERR_PTR(-EINVAL) if @oh is NULL; otherwise,
* passes along the return value of omap_device_build_ss().
*/
-struct platform_device *omap_device_build(const char *pdev_name, int pdev_id,
+struct platform_device *__init omap_device_build(const char *pdev_name, int pdev_id,
struct omap_hwmod *oh, void *pdata,
int pdata_len,
struct omap_device_pm_latency *pm_lats,
@@ -652,7 +652,7 @@ struct platform_device *omap_device_buil
* platform_device record. Returns an ERR_PTR() on error, or passes
* along the return value of omap_device_register().
*/
-struct platform_device *omap_device_build_ss(const char *pdev_name, int pdev_id,
+struct platform_device *__init omap_device_build_ss(const char *pdev_name, int pdev_id,
struct omap_hwmod **ohs, int oh_cnt,
void *pdata, int pdata_len,
struct omap_device_pm_latency *pm_lats,
@@ -717,7 +717,7 @@ odbs_exit:
* platform_early_add_device() on the underlying platform_device.
* Returns 0 by default.
*/
-static int omap_early_device_register(struct platform_device *pdev)
+static int __init omap_early_device_register(struct platform_device *pdev)
{
struct platform_device *devices[1];
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -29,7 +29,7 @@
#define NO_LENGTH_CHECK 0xffffffff
-struct omap_board_config_kernel *omap_board_config __initdata;
+struct omap_board_config_kernel *omap_board_config;
int omap_board_config_size;
unsigned char omap_bootloader_tag[1024];
@@ -58,7 +58,7 @@ __tagtable(ATAG_BOARD, parse_tag_omap);
#endif
-static const void *__init get_config(u16 tag, size_t len,
+static const void *get_config(u16 tag, size_t len,
int skip, size_t *len_out)
{
struct omap_board_config_kernel *kinfo = NULL;
@@ -125,12 +125,12 @@ static const void *__init get_config(u16
return kinfo->data;
}
-const void *__init __omap_get_config(u16 tag, size_t len, int nr)
+const void *__omap_get_config(u16 tag, size_t len, int nr)
{
return get_config(tag, len, nr, NULL);
}
-const void *__init omap_get_var_config(u16 tag, size_t *len)
+const void *omap_get_var_config(u16 tag, size_t *len)
{
return get_config(tag, NO_LENGTH_CHECK, 0, len);
}
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -380,7 +380,7 @@ static inline void omap_init_dmic(void)
#include <plat/mcspi.h>
-static int omap_mcspi_init(struct omap_hwmod *oh, void *unused)
+static int __init omap_mcspi_init(struct omap_hwmod *oh, void *unused)
{
struct platform_device *pdev;
char *name = "omap2_mcspi";
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -24,7 +24,7 @@
#include <plat/omap_hwmod.h>
#include <plat/omap_device.h>
-static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
+static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
{
struct platform_device *pdev;
struct omap_gpio_platform_data *pdata;
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -122,7 +122,7 @@ static int omap3_enable_st_clock(unsigne
return 0;
}
-static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
+static int __init omap_init_mcbsp(struct omap_hwmod *oh, void *unused)
{
int id, count = 1;
char *name = "omap-mcbsp";
--- a/arch/arm/plat-omap/include/plat/board.h
+++ b/arch/arm/plat-omap/include/plat/board.h
@@ -159,14 +159,14 @@ struct omap_gpio_switch_config {
int key_code:24; /* Linux key code */
};
-extern const void *__init __omap_get_config(u16 tag, size_t len, int nr);
+extern const void * __omap_get_config(u16 tag, size_t len, int nr);
#define omap_get_config(tag, type) \
((const type *) __omap_get_config((tag), sizeof(type), 0))
#define omap_get_nr_config(tag, type, nr) \
((const type *) __omap_get_config((tag), sizeof(type), (nr)))
-extern const void *__init omap_get_var_config(u16 tag, size_t *len);
+extern const void * omap_get_var_config(u16 tag, size_t *len);
extern struct omap_board_config_kernel *omap_board_config;
extern int omap_board_config_size;
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/n810-base
NAME:=Nokia n810 (base)
PACKAGES:= \
block-mount \
gpsd \
ip iw kmod-p54-spi wpa-supplicant \
dnsmasq dropbear \
pwrtray-backend \
kmod-fs-vfat kmod-fs-msdos \
kmod-input-evdev \
kmod-leds-gpio \
kmod-usb-tahvo kmod-usb-eth-gadget \
kmod-usb-net kmod-usb-net-cdc-ether kmod-usb-net-pegasus kmod-usb-net-rndis \
kmod-usb-storage kmod-usb-hid \
kmod-bluetooth kmod-bluetooth-hci-h4p bluez-utils bluez-hcidump \
kmod-n810bm maemo-kexec calvaria \
schedtool
endef
define Profile/n810-base/Description
Minimal package set for Nokia n810 hardware.
endef
$(eval $(call Profile,n810-base))
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Profile/n810-gui
$(call Profile/n810-base)
NAME:=Nokia n810 (GUI)
PACKAGES+= \
xserver-xorg xinit xauth xkeyboard-config xkbdata xterm \
xf86-video-omapfb xf86-input-tslib xf86-input-evdev \
openbox tint2 matchbox-keyboard \
pwrtray
endef
define Profile/n810-gui/Description
Graphical user interface package set for Nokia n810 hardware.
endef
$(eval $(call Profile,n810-gui))
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=orion
BOARDNAME:=Marvell Orion
FEATURES:=broken
SUBTARGETS:=generic harddisk
MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
KERNEL_PATCHVER:=3.18
include $(INCLUDE_DIR)/target.mk
KERNELNAME:=zImage
DEFAULT_PACKAGES += kmod-ath9k kmod-crypto-mv-cesa wpad-mini kmod-i2c-core kmod-i2c-mv64xxx kmod-rtc-isl1208
$(eval $(call BuildTarget))
#!/bin/sh
#
# Copyright (C) 2009-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
usb_led=''
usb_device=''
led_set_attr() {
[ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2"
}
usb_led_set_timer() {
led_set_attr "${usb_led}" 'trigger' 'timer'
led_set_attr "${usb_led}" 'delay_on' "$1"
led_set_attr "${usb_led}" 'delay_off' "$2"
}
usb_led_on() {
led_set_attr "${usb_led}" 'trigger' 'none'
led_set_attr "${usb_led}" 'brightness' 255
}
usb_led_off() {
led_set_attr "${usb_led}" 'trigger' 'none'
led_set_attr "${usb_led}" 'brightness' 0
}
get_usb_led() {
local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
case "${hardware}" in
'Linksys WRT350N v2')
usb_led='wrt350nv2:green:usb'
usb_device='1-1:1.0'
;;
esac;
}
get_usb_led
case "${ACTION}" in
add)
# update LEDs
[ "${usb_device}" = "${DEVICENAME}" ] && usb_led_on
;;
remove)
# update LEDs
[ "${usb_device}" = "${DEVICENAME}" ] && usb_led_off
;;
esac
config_simple() {
cat >> /etc/config/network <<EOF
config interface lan
option ifname eth0
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6assign 60
EOF
}
config_dsa() {
cat >> /etc/config/network <<EOF
config interface eth0
option ifname eth0
config interface wan
option ifname wan
option proto dhcp
option hostname openwrt
config interface lan
option ifname "lan1 lan2 lan3 lan4"
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6assign 60
config interface wan6
option ifname wan
option proto dhcpv6
config globals globals
option ula_prefix auto
EOF
}
cat > /etc/config/network <<EOF
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
EOF
if grep -q lan /proc/net/dev; then
config_dsa
else
config_simple
fi
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
CONFIG_ARCH_NR_GPIO=0
CONFIG_ARCH_ORION5X=y
# CONFIG_ARCH_ORION5X_DT is not set
CONFIG_ARCH_REQUIRE_GPIOLIB=y
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_ARM=y
# CONFIG_ARM_CPU_SUSPEND is not set
CONFIG_ARM_L1_CACHE_SHIFT=5
CONFIG_ARM_NR_BANKS=8
CONFIG_ARM_PATCH_PHYS_VIRT=y
# CONFIG_ARM_THUMB is not set
# CONFIG_ARPD is not set
CONFIG_ATAGS=y
CONFIG_AUTO_ZRELADDR=y
# CONFIG_CACHE_L2X0 is not set
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLKSRC_MMIO=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"
CONFIG_CMDLINE_FORCE=y
CONFIG_COMMON_CLK=y
CONFIG_CPU_32v5=y
CONFIG_CPU_ABRT_EV5T=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_COPY_FEROCEON=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_CPU_FEROCEON=y
CONFIG_CPU_FEROCEON_OLD_ID=y
# CONFIG_CPU_ICACHE_DISABLE is not set
CONFIG_CPU_PABRT_LEGACY=y
CONFIG_CPU_TLB_FEROCEON=y
CONFIG_CPU_USE_DOMAINS=y
CONFIG_CRYPTO_BLKCIPHER2=y
CONFIG_CRYPTO_DEV_MV_CESA=y
CONFIG_CRYPTO_HASH=y
CONFIG_CRYPTO_HASH2=y
CONFIG_CRYPTO_HW=y
CONFIG_CRYPTO_RNG2=y
CONFIG_CRYPTO_WORKQUEUE=y
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set
CONFIG_DEBUG_UART_8250_SHIFT=2
# CONFIG_DEBUG_UART_8250_WORD is not set
CONFIG_DEBUG_UART_PHYS=0xf1012000
CONFIG_DEBUG_UART_VIRT=0xfe012000
# CONFIG_DEBUG_USER is not set
CONFIG_DNOTIFY=y
CONFIG_FRAME_POINTER=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_GENERIC_IO=y
CONFIG_GENERIC_IRQ_CHIP=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_GPIO_SYSFS=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_PFN_VALID=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_HAVE_BPF_JIT=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CLK_PREPARE=y
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_HAVE_GENERIC_HARDIRQS=y
CONFIG_HAVE_IDE=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_NET_DSA=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_UID16=y
CONFIG_HZ_PERIODIC=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_WORK=y
CONFIG_KTIME_SCALAR=y
CONFIG_LEDS_GPIO=y
# CONFIG_MACH_BIGDISK is not set
# CONFIG_MACH_D2NET is not set
# CONFIG_MACH_D2NET_DT is not set
# CONFIG_MACH_DB88F5281 is not set
# CONFIG_MACH_DNS323 is not set
# CONFIG_MACH_DT2 is not set
# CONFIG_MACH_EDMINI_V2_DT is not set
# CONFIG_MACH_KUROBOX_PRO is not set
# CONFIG_MACH_LINKSTATION_LSCHL is not set
# CONFIG_MACH_LINKSTATION_LS_HGL is not set
# CONFIG_MACH_LINKSTATION_MINI is not set
# CONFIG_MACH_LINKSTATION_PRO is not set
# CONFIG_MACH_MSS2 is not set
# CONFIG_MACH_MSS2_DT is not set
# CONFIG_MACH_MV2120 is not set
# CONFIG_MACH_NET2BIG is not set
# CONFIG_MACH_RD88F5181L_FXO is not set
# CONFIG_MACH_RD88F5181L_GE is not set
# CONFIG_MACH_RD88F5182 is not set
# CONFIG_MACH_RD88F5182_DT is not set
# CONFIG_MACH_RD88F6183AP_GE is not set
# CONFIG_MACH_TERASTATION_PRO2 is not set
# CONFIG_MACH_TS209 is not set
# CONFIG_MACH_TS409 is not set
# CONFIG_MACH_TS78XX is not set
CONFIG_MACH_WN802T=y
CONFIG_MACH_WNR854T=y
CONFIG_MACH_WRT350N_V2=y
CONFIG_MDIO_BOARDINFO=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MTD_PHYSMAP=y
CONFIG_MV643XX_ETH=y
CONFIG_MVEBU_MBUS=y
CONFIG_MVMDIO=y
# CONFIG_MVNETA is not set
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_KUSER_HELPERS=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_NET_DSA=y
CONFIG_NET_DSA_MV88E6131=y
CONFIG_NET_DSA_MV88E6XXX=y
CONFIG_NET_DSA_MV88E6XXX_NEED_PPU=y
CONFIG_NET_DSA_TAG_DSA=y
CONFIG_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xC0000000
CONFIG_PCI=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PHYLIB=y
CONFIG_PLAT_ORION=y
CONFIG_PLAT_ORION_LEGACY=y
# CONFIG_PREEMPT_RCU is not set
# CONFIG_RCU_STALL_COMMON is not set
CONFIG_SCHED_HRTICK=y
# CONFIG_SCSI_DMA is not set
CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_UID16=y
CONFIG_UIDGID_CONVERTED=y
CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
CONFIG_USB_ARCH_HAS_XHCI=y
CONFIG_USB_SUPPORT=y
CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VFP is not set
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZONE_DMA_FLAG=0
#ifndef __INC_DT2_COMMON_H
#define __INC_DT2_COMMON_H
#define ATAG_MV_UBOOT 0x41000403
struct tag_mv_uboot {
u32 uboot_version;
u32 tclk;
u32 sysclk;
u32 isUsbHost;
u32 overEthAddr;
u8 dt2_eeprom[256];
};
#define DT2_EEPROM_ADDR 0x50
#define DT2_EEPROM_OFFSET 0
#define DT2_EEPROM_LENGTH 256
#define DT2_SERIAL_NUMBER_DEFAULT "run on default\0"
#define DT2_REVISION_DEFAULT_INIT 0xFF
#define DT2_CONFIG_FLAGS_DEFAULT 0x00
#define _PACKED_ __attribute__((packed))
struct DT2_EEPROM_SD_CONFIG {
unsigned int ram_1;
unsigned int ram_2;
unsigned int ram_3;
unsigned int ram_4;
unsigned char ram_5;
unsigned char ram_6;
unsigned short ram_7;
unsigned int magic_id;
} _PACKED_; // 24 Bytes in total
struct DT2_EEPROM_FC_CONFIG {
unsigned char rtc_sts_mask;
unsigned char rtc_sts_init;
unsigned char rtc_int_mask;
unsigned char rtc_int_init;
unsigned char rtc_atrim_init;
unsigned char rtc_dtrim_init;
unsigned char dummy1;
unsigned char dummy2;
unsigned char dt2_config_flags; /* 0x80 to load rtc_values to RTC */
unsigned char dt2_revision; /* upper nibble is HW, lower nibble is FW */
unsigned char dt2_serial_number[16]; /* Serial number of DT-2 */
} _PACKED_; // 26 Bytes in total
#define CFG_LOAD_RTC_VALUES 0x80
struct DT2_EEPROM_GW_CONFIG {
unsigned int dummy1;
unsigned int dummy2;
unsigned int dummy3;
unsigned char dummy4;
unsigned char tos_video_val1;
unsigned char tos_video_val2;
unsigned char tos_voip_val;
unsigned char qos_igmp_cfg;
unsigned char num_of_ifs;
unsigned short vlan_ports_if[3];
unsigned char mac_addr[3][6];
} _PACKED_; // 42 Bytes in total
#define _SIZE_OF_ALL_STRUCTS_ (sizeof(struct DT2_EEPROM_SD_CONFIG) + sizeof(struct DT2_EEPROM_FC_CONFIG) + sizeof(struct DT2_EEPROM_GW_CONFIG))
// MV = EEPROM - SD - FC - GW - CRC
struct DT2_EEPROM_MV_CONFIG {
unsigned int reg_addr[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)];
unsigned int reg_data[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)];
} _PACKED_;
struct DT2_EEPROM_STRUCT {
struct DT2_EEPROM_MV_CONFIG mv;
struct DT2_EEPROM_SD_CONFIG sd;
struct DT2_EEPROM_FC_CONFIG fc;
struct DT2_EEPROM_GW_CONFIG gw;
unsigned int crc;
} _PACKED_;
#endif
#!/bin/sh
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
#
# This script sets system defaults for the hardware on firstboot
#
local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
wrt350nv2_default() {
# leds
uci batch <<__EOF
set system.power_led=led
set system.power_led.name='Power LED (green)'
set system.power_led.sysfs='wrt350nv2:green:power'
set system.power_led.default='1'
set system.wifi_led=led
set system.wifi_led.name='Wireless LED (green)'
set system.wifi_led.sysfs='wrt350nv2:green:wireless'
set system.wifi_led.trigger='netdev'
set system.wifi_led.dev='wlan0'
set system.wifi_led.mode='link tx rx'
set system.wifi_led.default='0'
commit system
__EOF
# add mac address from U-Boot partition to lan and wan devices
MTD=`grep -e 'u-boot' /proc/mtd`
MTD=`echo ${MTD} | sed 's/[a-z]*\([0-9]*\):.*/\1/'`
[ -n "${MTD}" ] && {
MACADDR=`dd if=/dev/mtdblock${MTD} bs=1 skip=262048 count=6 2>/dev/null | hexdump -e '1/1 "%02x"'`
MACADDR2=$(( 0x${MACADDR} + 1))
MACADDR2=`printf "%012x" ${MACADDR2}`
MACADDR=`echo ${MACADDR} | sed 's/\(..\)/\1:/g' | sed 's/:$//'`
MACADDR2=`echo ${MACADDR2} | sed 's/\(..\)/\1:/g' | sed 's/:$//'`
uci set network.eth0.macaddr=${MACADDR}
uci set network.lan.macaddr=${MACADDR}
uci set network.wan.macaddr=${MACADDR2}
uci commit network
}
}
case "${hardware}" in
'Linksys WRT350N v2')
wrt350nv2_default
;;
esac
#
# Copyright (C) 2010-2011 OpenWrt.org
#
# use default "image" for PART_NAME
# use default for platform_do_upgrade()
platform_check_image() {
[ "${ARGC}" -gt 1 ] && { echo 'Too many arguments. Only flash file expected.'; return 1; }
local hardware=`sed -n /Hardware/s/.*:.//p /proc/cpuinfo`
local magic="$(get_magic_word "$1")"
local magic_long="$(get_magic_long "$1")"
case "${hardware}" in
# hardware with a direct uImage partition
# image header format as described in U-Boot's include/image.h
# see http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=blob;f=include/image.h
'Linksys WRT350N v2')
[ "${magic_long}" != '27051956' ] && {
echo "Invalid image type ${magic_long}."
return 1
}
return 0
;;
# Netgear WNR854T (has uImage as file inside a JFFS2 partition)
'Netgear WNR854T')
[ "${magic}" != '8519' ] && {
echo "Invalid image type ${magic}."
return 1
}
return 0
;;
esac
echo "Sysupgrade is not yet supported on ${hardware}."
return 1
}
#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
BOARDNAME:=Generic
FEATURES:=squashfs
define Target/Description
Build firmware images for Marvell Orion based boards that boot from internal flash.
(e.g.: Linksys WRT350N v2, Netgear WNR854T, ...)
endef
CONFIG_ATA=y
CONFIG_BLK_DEV_DM=y
CONFIG_BLK_DEV_MD=y
CONFIG_BLK_DEV_SD=y
CONFIG_CRC16=y
# CONFIG_DM_CRYPT is not set
# CONFIG_DM_MIRROR is not set
# CONFIG_DM_SNAPSHOT is not set
CONFIG_EXT4_FS=y
CONFIG_FS_MBCACHE=y
CONFIG_HWMON=y
CONFIG_I2C_BOARDINFO=y
CONFIG_JBD2=y
CONFIG_MACH_DT2=y
CONFIG_MACH_NET2BIG=y
# CONFIG_MACH_WN802T is not set
# CONFIG_MACH_WNR854T is not set
# CONFIG_MACH_WRT350N_V2 is not set
CONFIG_MD=y
CONFIG_MD_AUTODETECT=y
CONFIG_MD_LINEAR=y
# CONFIG_MD_MULTIPATH is not set
CONFIG_MD_RAID0=y
CONFIG_MD_RAID1=y
# CONFIG_MD_RAID10 is not set
# CONFIG_MD_RAID456 is not set
CONFIG_NLS=y
CONFIG_RTC_CLASS=y
CONFIG_SATA_MV=y
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
CONFIG_USB=y
CONFIG_USB_COMMON=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_EHCI_HCD_ORION=y
CONFIG_USB_EHCI_HCD_PLATFORM=y
CONFIG_USB_STORAGE=y
# CONFIG_USB_UHCI_HCD is not set
#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
BOARDNAME:=Internal Hard-Disk
FEATURES:=targz
define Target/Description
Build firmware images for Marvell Orion based boards that boot directly from internal disk storage.
(e.g.: Freecom DataTank 2, ...)
endef
#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
include $(SUBTARGET).mk
$(eval $(call BuildImage))
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
### DO NOT INDENT LINES CONTAINING $(call xyz) AS THIS MAY CHANGE THE CONTEXT
### OF THE FIRST LINE IN THE CALLED VARIABLE (NOTE: variable!)
### see http://www.gnu.org/software/make/manual/html_node/Call-Function.html#Call-Function
### ACTUALLY IT IS A SIMPLE MACRO EXPANSION
### use round brackets for make variables, and curly brackets for shell variables
## Kernel mtd partition size in KiB
KERNEL_MTD_SIZE:=1280
# Netgear WNR854T: erase size is 128KiB = 0x00020000 = 131072
ERASE_SIZE_128K:=128
# Linksys WRT350N v2: erase size is 64KiB = 0x00010000 = 65536
ERASE_SIZE_64K:=64
# define JFFS2 sizes for include/image.mk
JFFS2_BLOCKSIZE:=64k 128k
###
### Image/BuildKernel
###
define Image/BuildKernel
### Dummy comment for indented calls of Image/BuildKernel
## Netgear WN802T: mach id 3306 (0x0cea)
$(call Image/BuildKernel/ARM/zImage,wn802t,"\x0c\x1c\xa0\xe3\xea\x10\x81\xe3")
$(call Image/BuildKernel/ARM/uImage,wn802t)
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Image/BuildKernel/ARM/zImage,wn802t,"\x0c\x1c\xa0\xe3\xea\x10\x81\xe3",-initramfs)
$(call Image/BuildKernel/ARM/uImage,wn802t,-initramfs)
endif
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) # nothing more to do for a ramdisk build
$(call Image/BuildKernel/JFFS2uImage,wn802t,$(ERASE_SIZE_64K),uImage)
$(call Image/Default/FileSizeCheck,$(KDIR)/wn802t-uImage.jffs2,$(shell expr $(KERNEL_MTD_SIZE) \* 1024))
endif
## Netgear WNR854T: mach id 1801 (0x0709)
$(call Image/BuildKernel/ARM/zImage,wnr854t,"\x07\x1c\xa0\xe3\x09\x10\x81\xe3")
$(call Image/BuildKernel/ARM/uImage,wnr854t)
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Image/BuildKernel/ARM/zImage,wnr854t,"\x07\x1c\xa0\xe3\x09\x10\x81\xe3",-initramfs)
$(call Image/BuildKernel/ARM/uImage,wnr854t,-initramfs)
endif
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) # nothing more to do for a ramdisk build
$(call Image/BuildKernel/JFFS2uImage,wnr854t,$(ERASE_SIZE_128K),uImage)
$(call Image/Default/FileSizeCheck,$(KDIR)/wnr854t-uImage.jffs2,$(shell expr $(KERNEL_MTD_SIZE) \* 1024))
endif
## Linksys WRT350N v2: mach id 1633 (0x0661)
$(call Image/BuildKernel/ARM/zImage,wrt350nv2,"\x06\x1c\xa0\xe3\x61\x10\x81\xe3")
$(call Image/BuildKernel/ARM/uImage,wrt350nv2)
ifeq ($($CONFIG_TARGET_ROOTFS_INITRAMFS),y)
$(call Image/BuildKernel/ARM/zImage,wrt350nv2,"\x06\x1c\xa0\xe3\x61\x10\x81\xe3",-initramfs)
$(call Image/BuildKernel/ARM/uImage,wrt350nv2-initramfs)
endif
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) # nothing more to do for a ramdisk build
$(call Image/Default/FileSizeCheck,$(KDIR)/wrt350nv2-uImage,$(shell expr $(KERNEL_MTD_SIZE) \* 1024))
endif
endef
define Image/BuildKernel/ARM/zImage
# merge machine id and regular zImage into one file
# parameters: 1 = machine name, 2 = machine id as string in quotes
# $(BOARD) kernel zImage for $(1)
echo -en $(2) > '$(KDIR)/$(1)-zImage$(3)'
cat '$(KDIR)/zImage$(3)' >> '$(KDIR)/$(1)-zImage$(3)'
endef
define Image/BuildKernel/ARM/uImage
# create uImage from zImage
# parameters: 1 = machine name
# $(BOARD) kernel uImage for $(1)
'$(STAGING_DIR_HOST)/bin/mkimage' -A arm -O linux -T kernel \
-C none -a 0x00008000 -e 0x00008000 -n 'Linux-$(LINUX_VERSION)' \
-d '$(KDIR)/$(1)-zImage$(2)' '$(KDIR)/$(1)-uImage$(2)'
ifeq ($(2),-initramfs) # only copy uImage for ramdisk build
cp '$(KDIR)/$(1)-uImage-initramfs' '$(BIN_DIR)/openwrt-$(1)-uImage-initramfs'
endif
endef
define Image/BuildKernel/JFFS2uImage
# create JFFS2 partition with uImage file (result is already padded to erase size)
# parameters: 1 = machine name, 2 = erase size in KiB, 3 = uImage file name
# $(BOARD) kernel uImage for $(1) in JFFS2-$(2)k partition
rm -rf '$(TMP_DIR)/$(1)_jffs2_uimage'
mkdir '$(TMP_DIR)/$(1)_jffs2_uimage'
cp '$(KDIR)/$(1)-uImage' '$(TMP_DIR)/$(1)_jffs2_uimage/$(3)'
$(STAGING_DIR_HOST)/bin/mkfs.jffs2 --compression-mode=none --pad --little-endian --squash -e $(2)KiB -o '$(KDIR)/$(1)-uImage.jffs2' -d '$(TMP_DIR)/$(1)_jffs2_uimage'
rm -rf '$(TMP_DIR)/$(1)_jffs2_uimage'
endef
define Image/Default/FileSizeCheck
# parameters: 1 = file path, 2 = maximum size in bytes
[ `stat -c %s '$(1)'` -le $(2) ] || { echo ' ERROR: $(1) too big (> $(2) bytes)'; exit 1; }
endef
###
### Image/Build
###
define Image/Build
### Dummy comment for indented calls of Image/Build with $(1)
## Prepare rootfs
$(call Image/Build/$(1),$(1))
## Netgear WN802T
$(call Image/Build/Default,$(1),wn802t,$(ERASE_SIZE_64K),$(KERNEL_MTD_SIZE),.jffs2,NG_WN802T)
## Netgear WNR854T
$(call Image/Build/Default,$(1),wnr854t,$(ERASE_SIZE_128K),$(KERNEL_MTD_SIZE),.jffs2,NG_WNR854T)
## Linksys WRT350N v2
$(call Image/Build/Linksys/wrt350nv2,$(1),wrt350nv2,$(ERASE_SIZE_64K),$(KERNEL_MTD_SIZE),)
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
endef
## generate defines for all JFFS2 block sizes
define Image/Build/jffs2/sub
$(eval define Image/Build/jffs2-$(1)
cp '$$(KDIR)/root.jffs2-$(1)' '$$(BIN_DIR)/$$(IMG_PREFIX)-root.jffs2-$(1)'
endef)
endef
$(foreach SZ,$(JFFS2_BLOCKSIZE),$(call Image/Build/jffs2/sub,$(SZ)))
define Image/Build/Default
# parameters: 1 = rootfs type, 2 = machine name, 3 = erase size in KiB, 4 = kernel mtd size in KiB, 5 = kernel file suffix, 6 = header
ifeq ($(findstring jffs2-,$(1)),jffs2-) # JFFS2: build only image fitting to erase size
ifeq ($(1),jffs2-$(3)k)
$(call Image/Build/Default/sysupgrade,$(1),$(2),$(4),$(5))
$(call Image/Build/Default/factory,$(1),$(2),$(6))
endif
else
ifeq ($(1),ext4) # EXT4: ignore
# do nothing
else # do all other images
$(call Image/Build/Default/sysupgrade,$(1),$(2),$(4),$(5))
$(call Image/Build/Default/factory,$(1),$(2),$(6))
endif
endif
endef
define Image/Build/Default/sysupgrade
# parameters: 1 = rootfs type, 2 = machine name, 3 = pad size in KiB (kernel mtd size or erase size), 4 = kernel file suffix
# $(BOARD) $(1) sysupgrade image for $(2)
( \
dd if='$(KDIR)/$(2)-uImage$(4)' bs=$(3)k conv=sync; \
dd if='$(KDIR)/root.$(1)'; \
) > '$(BIN_DIR)/openwrt-$(2)-$(1)-sysupgrade.img'
endef
define Image/Build/Default/factory
# parameters: 1 = rootfs type, 2 = machine name, 3 = header
# $(BOARD) $(1) factory upgrade image for $(2)
'$(STAGING_DIR_HOST)/bin/add_header' $(3) '$(BIN_DIR)/openwrt-$(2)-$(1)-sysupgrade.img' '$(BIN_DIR)/openwrt-$(2)-$(1)-factory.img'
endef
##
## Image/Build/Linksys
##
define Image/Build/Linksys/wrt350nv2
# parameters: 1 = rootfs type, 2 = machine name, 3 = erase size in KiB, 4 = kernel mtd size in KiB, 5 = kernel file suffix
ifeq ($(findstring jffs2-,$(1)),jffs2-) # JFFS2: build only image fitting to erase size
ifeq ($(1),jffs2-$(3)k)
$(call Image/Build/Default/sysupgrade,$(1),$(2),$(4),$(5))
$(call Image/Build/Linksys/wrt350nv2-builder,$(1),$(2))
endif
else
ifeq ($(1),ext4) # EXT4: ignore
# do nothing
else # do all other images
$(call Image/Build/Default/sysupgrade,$(1),$(2),$(4),$(5))
$(call Image/Build/Linksys/wrt350nv2-builder,$(1),$(2))
endif
endif
endef
define Image/Build/Linksys/wrt350nv2-builder
# parameters: 1 = rootfs type, 2 = machine name
# $(BOARD) $(1) factory and recovery image for $(2) via wrt350nv2-builder
rm -rf '$(TMP_DIR)/$(2)_factory'
mkdir '$(TMP_DIR)/$(2)_factory'
# create parameter file
echo ':image 0 $(BIN_DIR)/openwrt-$(2)-$(1)-sysupgrade.img' > '$(TMP_DIR)/$(2)_factory/$(2).par'
[ ! -f '$(STAGING_DIR_HOST)/share/wrt350nv2-builder/u-boot.bin' ] || ( \
echo ':u-boot 0 $(STAGING_DIR_HOST)/share/wrt350nv2-builder/u-boot.bin' >> '$(TMP_DIR)/$(2)_factory/$(2).par'; \
)
echo '#version 0x2020' >> '$(TMP_DIR)/$(2)_factory/$(2).par'
# create bin file for recovery and factory image
( \
cd '$(TMP_DIR)/$(2)_factory'; \
'$(STAGING_DIR_HOST)/bin/wrt350nv2-builder' -b '$(TMP_DIR)/$(2)_factory/$(2).par'; \
)
# copy bin file as recovery image
$(CP) '$(TMP_DIR)/$(2)_factory/wrt350n.bin' '$(BIN_DIR)/openwrt-$(2)-$(1)-recovery.bin'
# create factory image for stock firmware update mechanism
( \
cd '$(TMP_DIR)/$(2)_factory'; \
zip 'wrt350n.zip' 'wrt350n.bin'; \
)
'$(STAGING_DIR_HOST)/bin/wrt350nv2-builder' -z '$(TMP_DIR)/$(2)_factory/wrt350n.zip' '$(BIN_DIR)/openwrt-$(2)-$(1)-factory.img'
rm -rf '$(TMP_DIR)/$(2)_factory'
endef
###
### Image/PreReq
###
## Dependency for WRT350N v2 factory image
$(eval $(call RequireCommand,zip, \
Please install zip. \
))
#
# Copyright (C) 2008-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define Image/BuildKernelMachId
echo -en "\x$(2)\x1c\xa0\xe3\x$(3)\x10\x81\xe3" > $(KDIR)/$(1)-zImage
cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/$(1)-zImage
$(STAGING_DIR_HOST)/bin/mkimage -A arm -O linux -T kernel \
-C none -a 0x00008000 -e 0x00008000 -n 'Linux-$(LINUX_VERSION)' \
-d $(KDIR)/$(1)-zImage $(KDIR)/$(1)-uImage
cp $(KDIR)/$(1)-uImage $(BIN_DIR)/openwrt-$(1)-uImage
endef
define Image/BuildKernel
# Orion Kernel uImages
# DT2: mach id 1514 (0x5EA)
$(call Image/BuildKernelMachId,dt2,05,ea)
# LaCie 2big Network: mach id 2342 (0x926)
$(call Image/BuildKernelMachId,net2big,09,26)
endef
define Image/Build/Freecom
# Orion Freecom Images
# backup unwanted files
rm -rf ${TMP_DIR}/$2_backup
mkdir ${TMP_DIR}/$2_backup
-mv $(TARGET_DIR)/{var,jffs,rom} ${TMP_DIR}/$2_backup
# add extra files
$(INSTALL_DIR) $(TARGET_DIR)/boot
# TODO: Add special CMDLINE shim for webupgrade image here
$(CP) $(KDIR)/dt2-uImage $(TARGET_DIR)/boot/uImage
$(INSTALL_DIR) $(TARGET_DIR)/var
# create image
$(TAR) cfj $(BIN_DIR)/openwrt-$(2)-$(1).img --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
$(STAGING_DIR_HOST)/bin/encode_crc $(BIN_DIR)/openwrt-$(2)-$(1).img $(BIN_DIR)/openwrt-$(2)-$(1)-webupgrade.img $(3)
# remove extra files
rm -rf $(TARGET_DIR)/{boot,var}
# recover unwanted files
-mv ${TMP_DIR}/$2_backup/* $(TARGET_DIR)/
rm -rf ${TMP_DIR}/$2_backup
endef
define Image/Build
$(call Image/Build/$(1),$(1))
$(call Image/Build/Freecom,$(1),dt2,DT,$(1))
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
( \
dd if=$(KDIR)/uImage bs=1024k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
endef
--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c
+++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c
@@ -134,11 +134,11 @@ static struct mtd_partition wrt350n_v2_n
{
.name = "kernel",
.offset = 0x00000000,
- .size = 0x00760000,
+ .size = 0x00140000, // change to kernel mtd size here (1/3)
}, {
.name = "rootfs",
- .offset = 0x001a0000,
- .size = 0x005c0000,
+ .offset = 0x00140000, // change to kernel mtd size here (2/3)
+ .size = 0x00610000, // adopt to kernel mtd size here (3/3) = 0x00750000 - <kernel mtd size>
}, {
.name = "lang",
.offset = 0x00760000,
@@ -151,6 +151,14 @@ static struct mtd_partition wrt350n_v2_n
.name = "u-boot",
.offset = 0x007c0000,
.size = 0x00040000,
+ }, {
+ .name = "eRcOmM_do_not_touch",
+ .offset = 0x00750000,
+ .size = 0x00010000, // erasesize
+ }, {
+ .name = "image", // for sysupgrade
+ .offset = 0x00000000,
+ .size = 0x00750000,
},
};
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -57,15 +57,19 @@ static struct mtd_partition wnr854t_nor_
{
.name = "kernel",
.offset = 0x00000000,
- .size = 0x00100000,
+ .size = 0x00140000,
}, {
.name = "rootfs",
- .offset = 0x00100000,
- .size = 0x00660000,
+ .offset = 0x00140000,
+ .size = 0x00620000,
}, {
.name = "uboot",
.offset = 0x00760000,
.size = 0x00040000,
+ }, {
+ .name = "image", // for sysupgrade
+ .offset = 0x00000000,
+ .size = 0x00760000,
},
};
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -36,6 +36,13 @@ config MACH_RD88F5182_DT
Say 'Y' here if you want your kernel to support the Marvell
Orion-NAS (88F5182) RD2, Flattened Device Tree.
+config MACH_DT2
+ bool "Freecom DataTank Gateway"
+ select I2C_BOARDINFO
+ help
+ Say 'Y' here if you want your kernel to support the
+ Freecom DataTank Gateway
+
config MACH_KUROBOX_PRO
bool "KuroBox Pro"
select I2C_BOARDINFO
--- a/arch/arm/mach-orion5x/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -14,6 +14,7 @@ obj-$(CONFIG_MACH_TS78XX) += ts78xx-setu
obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o
obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o
obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o
+obj-$(CONFIG_MACH_DT2) += dt2-setup.o
obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o
obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o
obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o
--- a/arch/arm/mach-orion5x/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -144,10 +144,13 @@ config MACH_MSS2_DT
Maxtor Shared Storage II platform.
config MACH_WNR854T
- bool "Netgear WNR854T"
+ bool "Netgear WNR854T / WN802T"
help
Say 'Y' here if you want your kernel to support the
- Netgear WNR854T platform.
+ Netgear WNR854T or WN802T platform.
+
+config MACH_WN802T
+ def_bool MACH_WNR854T
config MACH_RD88F5181L_GE
bool "Marvell Orion-VoIP GE Reference Design"
--- a/arch/arm/mach-orion5x/wnr854t-setup.c
+++ b/arch/arm/mach-orion5x/wnr854t-setup.c
@@ -115,6 +115,15 @@ static struct dsa_platform_data wnr854t_
.chip = &wnr854t_switch_chip_data,
};
+static struct dsa_chip_data wn802t_switch_chip_data = {
+ .port_names[2] = "wan",
+ .port_names[3] = "cpu",
+};
+
+static struct dsa_platform_data wn802t_switch_plat_data = {
+ .nr_chips = 1,
+ .chip = &wn802t_switch_chip_data,
+};
static void __init wnr854t_init(void)
{
/*
@@ -128,7 +137,12 @@ static void __init wnr854t_init(void)
* Configure peripherals.
*/
orion5x_eth_init(&wnr854t_eth_data);
- orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
+
+ if (machine_is_wn802t())
+ orion5x_eth_switch_init(&wn802t_switch_plat_data, NO_IRQ);
+ else
+ orion5x_eth_switch_init(&wnr854t_switch_plat_data, NO_IRQ);
+
orion5x_uart0_init();
mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET,
@@ -168,7 +182,7 @@ static struct hw_pci wnr854t_pci __initd
static int __init wnr854t_pci_init(void)
{
- if (machine_is_wnr854t())
+ if (machine_is_wnr854t() || machine_is_wn802t())
pci_common_init(&wnr854t_pci);
return 0;
@@ -179,6 +193,18 @@ MACHINE_START(WNR854T, "Netgear WNR854T"
/* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
.atag_offset = 0x100,
.init_machine = wnr854t_init,
+ .map_io = orion5x_map_io,
+ .init_early = orion5x_init_early,
+ .init_irq = orion5x_init_irq,
+ .init_time = orion5x_timer_init,
+ .fixup = tag_fixup_mem32,
+ .restart = orion5x_restart,
+MACHINE_END
+
+MACHINE_START(WN802T, "Netgear WN802T")
+ /* Maintainer: Imre Kaloz <kaloz@openwrt.org> */
+ .atag_offset = 0x100,
+ .init_machine = wnr854t_init,
.map_io = orion5x_map_io,
.init_early = orion5x_init_early,
.init_irq = orion5x_init_irq,
#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=powerpc
BOARD:=ppc40x
BOARDNAME:=AMCC/IBM PPC40x
FEATURES:=squashfs broken
CPU_TYPE:=405
MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
KERNEL_PATCHVER:=3.18
include $(INCLUDE_DIR)/target.mk
define Target/Description
Build firmware images for AMCC/IBM PPC40x based boards.
endef
KERNELNAME:=uImage cuImage.magicbox cuImage.openrb
$(eval $(call BuildTarget))
#!/bin/sh
#
# Copyright (C) 2010 OpenWrt.org
#
ppc40x_board_name() {
local model
model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo)
echo $model
}
#
# Copyright (C) 2010 OpenWrt.org
#
. /lib/ppc40x.sh
PART_NAME=firmware
RAMFS_COPY_DATA=/lib/ppc40x.sh
platform_check_image() {
local board=$(ppc40x_board_name)
local magic="$(get_magic_word "$1")"
[ "$#" -gt 1 ] && return 1
case "$board" in
kilauea | openrb | magicbox)
[ "$magic" != "2705" ] && {
echo "Invalid image type."
return 1
}
return 0
;;
esac
echo "Sysupgrade is not yet supported on $board."
return 1
}
platform_do_upgrade() {
local board=$(ppc40x_board_name)
case "$board" in
*)
default_do_upgrade "$ARGV"
;;
esac
}
CONFIG_405EX=y
CONFIG_40x=y
# CONFIG_44x is not set
CONFIG_4xx=y
CONFIG_4xx_SOC=y
# CONFIG_ACADIA is not set
# CONFIG_ADVANCED_OPTIONS is not set
CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_ARCH_HAS_SG_CHAIN=y
CONFIG_ARCH_HAS_WALK_MEMORY=y
CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
# CONFIG_ARCH_RANDOM is not set
CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_USE_BUILTIN_BSWAP=y
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
CONFIG_AUDIT_ARCH=y
CONFIG_BOUNCE=y
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="console=ttyS0,115200 rootfstype=squashfs,jffs2 noinitrd"
CONFIG_CMDLINE_BOOL=y
CONFIG_CONSISTENT_SIZE=0x00200000
CONFIG_CPU_BIG_ENDIAN=y
# CONFIG_CPU_LITTLE_ENDIAN is not set
# CONFIG_CRYPTO_SHA1_PPC is not set
# CONFIG_DEFAULT_UIMAGE is not set
CONFIG_DTC=y
# CONFIG_E200 is not set
CONFIG_EARLY_PRINTK=y
# CONFIG_EP405 is not set
# CONFIG_EPAPR_BOOT is not set
CONFIG_EXTRA_TARGETS="uImage"
# CONFIG_FSL_ULI1575 is not set
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_CMOS_UPDATE=y
# CONFIG_GENERIC_CSUM is not set
CONFIG_GENERIC_IO=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_NVRAM=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_GENERIC_TIME_VSYSCALL_OLD=y
# CONFIG_GEN_RTC is not set
# CONFIG_GE_FPGA is not set
CONFIG_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_GPIO_SYSFS=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
# CONFIG_HAS_RAPIDIO is not set
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_ARCH_AUDITSYSCALL=y
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
CONFIG_HAVE_IDE=y
CONFIG_HAVE_IOREMAP_PROT=y
CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_HAVE_NET_DSA=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
# CONFIG_HOTFOOT is not set
CONFIG_HW_RANDOM=y
CONFIG_HZ=250
# CONFIG_HZ_100 is not set
CONFIG_HZ_250=y
CONFIG_HZ_PERIODIC=y
CONFIG_IBM_EMAC=y
CONFIG_IBM_EMAC_EMAC4=y
CONFIG_IBM_EMAC_POLL_WEIGHT=32
CONFIG_IBM_EMAC_RGMII=y
CONFIG_IBM_EMAC_RXB=256
CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
CONFIG_IBM_EMAC_RX_SKB_HEADROOM=0
CONFIG_IBM_EMAC_TXB=256
CONFIG_INITRAMFS_SOURCE=""
# CONFIG_IOMMU_HELPER is not set
# CONFIG_IPIC is not set
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_IRQ_WORK=y
CONFIG_ISA_DMA_API=y
CONFIG_KERNEL_START=0xc0000000
CONFIG_KILAUEA=y
CONFIG_LIBFDT=y
CONFIG_LOWMEM_SIZE=0x30000000
CONFIG_MAGICBOX=y
# CONFIG_MAKALU is not set
# CONFIG_MATH_EMULATION is not set
# CONFIG_MMIO_NVRAM is not set
CONFIG_MODULES_USE_ELF_RELA=y
# CONFIG_MPIC is not set
# CONFIG_MPIC_U3_HT_IRQS is not set
# CONFIG_MPIC_WEIRD is not set
CONFIG_MTD_CFI_ADV_OPTIONS=y
# CONFIG_MTD_CFI_GEOMETRY is not set
# CONFIG_MTD_CFI_INTELEXT is not set
CONFIG_MTD_SPLIT_FIRMWARE=y
CONFIG_MTD_SPLIT_UIMAGE_FW=y
CONFIG_NEED_DMA_MAP_STATE=y
# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
CONFIG_NEED_PER_CPU_KM=y
CONFIG_NEED_SG_DMA_LENGTH=y
# CONFIG_NONSTATIC_KERNEL is not set
CONFIG_NOT_COHERENT_CACHE=y
CONFIG_NR_IRQS=512
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_ADDRESS_PCI=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_MTD=y
CONFIG_OF_NET=y
CONFIG_OF_PCI=y
CONFIG_OF_PCI_IRQ=y
CONFIG_OF_RESERVED_MEM=y
CONFIG_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND=y
CONFIG_OPENRB=y
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xc0000000
CONFIG_PCI=y
CONFIG_PCIEAER=y
CONFIG_PCIEPORTBUS=y
CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
CONFIG_PCI_DOMAINS=y
CONFIG_PCI_MSI=y
CONFIG_PHYSICAL_START=0x00000000
CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_PPC40x_SIMPLE=y
# CONFIG_PPC4xx_HSTA_MSI is not set
CONFIG_PPC4xx_MSI=y
# CONFIG_PPC4xx_OCM is not set
CONFIG_PPC4xx_PCI_EXPRESS=y
# CONFIG_PPC64 is not set
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
# CONFIG_PPC_970_NAP is not set
CONFIG_PPC_ADV_DEBUG_DACS=2
CONFIG_PPC_ADV_DEBUG_DVCS=0
CONFIG_PPC_ADV_DEBUG_IACS=2
CONFIG_PPC_ADV_DEBUG_REGS=y
# CONFIG_PPC_BOOK3S_32 is not set
# CONFIG_PPC_CELL is not set
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PPC_COPRO_BASE is not set
CONFIG_PPC_DCR=y
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_PPC_DCR_NATIVE=y
# CONFIG_PPC_DOORBELL is not set
# CONFIG_PPC_EARLY_DEBUG is not set
# CONFIG_PPC_EPAPR_HV_PIC is not set
# CONFIG_PPC_I8259 is not set
# CONFIG_PPC_ICP_HV is not set
# CONFIG_PPC_ICP_NATIVE is not set
# CONFIG_PPC_ICS_RTAS is not set
CONFIG_PPC_INDIRECT_PCI=y
CONFIG_PPC_MMU_NOHASH=y
# CONFIG_PPC_MM_SLICES is not set
# CONFIG_PPC_MPC106 is not set
CONFIG_PPC_MSI_BITMAP=y
CONFIG_PPC_OF=y
# CONFIG_PPC_P7_NAP is not set
CONFIG_PPC_PCI_CHOICE=y
# CONFIG_PPC_RTAS is not set
CONFIG_PPC_UDBG_16550=y
CONFIG_PPC_WERROR=y
# CONFIG_PPC_XICS is not set
# CONFIG_PQ2ADS is not set
# CONFIG_PREEMPT_RCU is not set
CONFIG_RAS=y
# CONFIG_RCU_STALL_COMMON is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_SCHED_HRTICK=y
# CONFIG_SCSI_DMA is not set
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_FSL=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_OF_PLATFORM=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
CONFIG_SPARSE_IRQ=y
# CONFIG_SWIOTLB is not set
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_TASK_SIZE=0xc0000000
CONFIG_TICK_CPU_ACCOUNTING=y
CONFIG_USB_SUPPORT=y
# CONFIG_WALNUT is not set
CONFIG_WORD_SIZE=32
# CONFIG_XILINX_SYSACE is not set
# CONFIG_XILINX_VIRTEX_GENERIC_BOARD is not set
CONFIG_XZ_DEC_BCJ=y
CONFIG_XZ_DEC_POWERPC=y
#
# Copyright (C) 2008-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
JFFS2_BLOCKSIZE=128k 64k
define Image/Prepare
$(LINUX_DIR)/scripts/dtc/dtc -O dtb -R 4 -S 0x20000 $(DTS_DIR)/kilauea.dts > $(KDIR)/openwrt-kilauea.dtb
endef
define Image/BuildKernel
cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
$(call Image/Build/Initramfs)
endef
define Image/Build
$(call Image/Build/$(1),$(1))
endef
define Image/Build/ext2
cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-ext2.img
endef
define Image/Build/jffs2-128k
( \
dd if=$(KDIR)/uImage bs=1920k conv=sync; \
dd if=$(KDIR)/openwrt-kilauea.dtb bs=128k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-kilauea-jffs2.img
endef
define Image/Build/jffs2-64k
( \
dd if=$(KDIR)/cuImage.magicbox bs=1408k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-magicbox-jffs2.img
( \
dd if=$(KDIR)/cuImage.openrb bs=1408k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-openrb-jffs2.img
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
( \
dd if=$(KDIR)/uImage bs=1920k conv=sync; \
dd if=$(KDIR)/openwrt-kilauea.dtb bs=128k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-kilauea-$(1).img
( \
dd if=$(KDIR)/cuImage.magicbox bs=64k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-magicbox-$(1).img
( \
dd if=$(KDIR)/cuImage.openrb bs=1408k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
) > $(BIN_DIR)/$(IMG_PREFIX)-openrb-$(1).img
endef
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
define Image/Build/Initramfs
cp $(KDIR)/cuImage.magicbox-initramfs $(BIN_DIR)/openwrt-$(BOARD)-magicbox-initramfs.bin
cp $(KDIR)/cuImage.openrb-initramfs $(BIN_DIR)/openwrt-$(BOARD)-openrb-initramfs.bin
endef
endif
$(eval $(call BuildImage))
#
# Copyright (C) 2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
define KernelPackage/ata-magicbox-cf
SUBMENU:=$(BLOCK_MENU)
TITLE:=Magicbox v2/OpenRB Compact flash support
DEPENDS:=@TARGET_ppc40x
KCONFIG:=CONFIG_PATA_MAGICBOX_CF
FILES:=$(LINUX_DIR)/drivers/ata/pata_magicbox_cf.ko
AUTOLOAD:=$(call AutoLoad,41,pata_magicbox_cf,1)
$(call AddDepends/ata)
endef
define KernelPackage/ata-magicbox-cf/description
Support for Magicbox v2/OpenRB on-board CF slot.
endef
$(eval $(call KernelPackage,ata-magicbox-cf))
define KernelPackage/usb-isp116x-hcd
TITLE:=Support for the ISP116x USB Host Controller
DEPENDS:=@TARGET_ppc40x
KCONFIG:= \
CONFIG_USB_ISP116X_HCD \
CONFIG_USB_ISP116X_HCD_OF=y \
CONFIG_USB_ISP116X_HCD_PLATFORM=n
FILES:=$(LINUX_DIR)/drivers/usb/host/isp116x-hcd.ko
AUTOLOAD:=$(call AutoLoad,50,isp116x-hcd)
$(call AddDepends/usb)
endef
define KernelPackage/usb-isp116x-hcd/description
Kernel support for the ISP116X USB Host Controller
endef
$(eval $(call KernelPackage,usb-isp116x-hcd))
--- a/arch/powerpc/boot/dcr.h
+++ b/arch/powerpc/boot/dcr.h
@@ -59,6 +59,14 @@ static const unsigned long sdram_bxcr[]
#define EBC_BXCR(n) (n)
#define EBC_BXCR_BAS 0xfff00000
#define EBC_BXCR_BS 0x000e0000
+#define EBC_BXCR_BS_1M 0x00000000
+#define EBC_BXCR_BS_2M 0x00020000
+#define EBC_BXCR_BS_4M 0x00040000
+#define EBC_BXCR_BS_8M 0x00060000
+#define EBC_BXCR_BS_16M 0x00080000
+#define EBC_BXCR_BS_32M 0x000a0000
+#define EBC_BXCR_BS_64M 0x000c0000
+#define EBC_BXCR_BS_128M 0x000e0000
#define EBC_BXCR_BANK_SIZE(reg) \
(0x100000 << (((reg) & EBC_BXCR_BS) >> 17))
#define EBC_BXCR_BU 0x00018000
@@ -67,6 +75,9 @@ static const unsigned long sdram_bxcr[]
#define EBC_BXCR_BU_WO 0x00010000
#define EBC_BXCR_BU_RW 0x00018000
#define EBC_BXCR_BW 0x00006000
+#define EBC_BXCR_BW_8 0x00000000
+#define EBC_BXCR_BW_16 0x00002000
+#define EBC_BXCR_BW_32 0x00006000
#define EBC_B0AP 0x10
#define EBC_B1AP 0x11
#define EBC_B2AP 0x12
--- a/arch/powerpc/boot/dts/kilauea.dts
+++ b/arch/powerpc/boot/dts/kilauea.dts
@@ -102,8 +102,8 @@
compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2";
dcr-reg = <0x010 0x002>;
interrupt-parent = <&UIC2>;
- interrupts = <0x5 0x4 /* ECC DED Error */
- 0x6 0x4>; /* ECC SEC Error */
+ interrupts = <0x5 0x4 /* ECC DED Error */
+ 0x6 0x4>; /* ECC SEC Error */
};
CRYPTO: crypto@ef700000 {
@@ -157,30 +157,30 @@
reg = <0x00000000 0x00000000 0x04000000>;
#address-cells = <1>;
#size-cells = <1>;
- partition@0 {
+ partition0@0 {
label = "kernel";
reg = <0x00000000 0x001e0000>;
};
- partition@1e0000 {
+ partition1@1e0000 {
label = "dtb";
reg = <0x001e0000 0x00020000>;
};
- partition@200000 {
- label = "root";
- reg = <0x00200000 0x00200000>;
- };
- partition@400000 {
- label = "user";
- reg = <0x00400000 0x03b60000>;
+ partition2@200000 {
+ label = "rootfs";
+ reg = <0x00200000 0x03d60000>;
};
- partition@3f60000 {
+ partition3@3f60000 {
label = "env";
reg = <0x03f60000 0x00040000>;
};
- partition@3fa0000 {
+ partition4@3fa0000 {
label = "u-boot";
reg = <0x03fa0000 0x00060000>;
};
+ partition5@0 {
+ label = "firmware";
+ reg = <0x00000000 0x03f60000>;
+ };
};
ndfc@1,0 {
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -1533,6 +1533,7 @@ static struct hc_driver isp116x_hc_drive
/*----------------------------------------------------------------*/
+#ifdef CONFIG_USB_ISP116X_HCD_PLATFORM
static int isp116x_remove(struct platform_device *pdev)
{
struct usb_hcd *hcd = platform_get_drvdata(pdev);
@@ -1711,4 +1712,251 @@ static struct platform_driver isp116x_dr
},
};
-module_platform_driver(isp116x_driver);
+static inline int isp116x_platform_register(void)
+{
+ return platform_driver_register(&isp116x_driver);
+}
+
+static inline void isp116x_platform_unregister(void)
+{
+ platform_driver_unregister(&isp116x_driver);
+}
+#else
+static inline int isp116x_platform_register(void) { return 0; };
+static void isp116x_platform_unregister(void) {};
+#endif /* CONFIG_USB_ISP116X_PLATFORM */
+
+/*-----------------------------------------------------------------*/
+
+#ifdef CONFIG_USB_ISP116X_HCD_OF
+
+/* TODO: rework platform probe instead of using a separate probe */
+
+#include <linux/of_platform.h>
+
+#ifdef USE_PLATFORM_DELAY
+static void isp116x_of_delay(struct device *ddev, int delay)
+{
+ ndelay(delay);
+}
+#else
+#define isp116x_of_delay NULL
+#endif
+
+static int isp116x_of_probe(struct platform_device *op)
+{
+ struct device_node *dn = op->dev.of_node;
+ struct usb_hcd *hcd;
+ struct isp116x *isp116x;
+ struct resource addr, data;
+ struct isp116x_platform_data *board;
+ void __iomem *addr_reg;
+ void __iomem *data_reg;
+ int irq;
+ int ret = 0;
+ unsigned long irqflags;
+
+ ret = of_address_to_resource(dn, 0, &data);
+ if (ret)
+ return ret;
+
+ ret = of_address_to_resource(dn, 1, &addr);
+ if (ret)
+ return ret;
+
+ board = kzalloc(sizeof(struct isp116x_platform_data), GFP_KERNEL);
+ if (board == NULL)
+ return -ENOMEM;
+
+ if (!request_mem_region(addr.start, resource_size(&addr), hcd_name)) {
+ ret = -EBUSY;
+ goto err_free_board;
+ }
+
+ addr_reg = ioremap_nocache(addr.start, resource_size(&addr));
+ if (addr_reg == NULL) {
+ ret = -ENOMEM;
+ goto err_release_addr;
+ }
+
+ if (!request_mem_region(data.start, resource_size(&data), hcd_name)) {
+ ret = -EBUSY;
+ goto err_unmap_addr;
+ }
+
+ data_reg = ioremap_nocache(data.start, resource_size(&data));
+ if (data_reg == NULL) {
+ ret = -ENOMEM;
+ goto err_release_data;
+ }
+
+ irq = irq_of_parse_and_map(dn, 0);
+ if (irq == NO_IRQ) {
+ ret = -EINVAL;
+ goto err_unmap_data;
+ }
+
+ /* allocate and initialize hcd */
+ hcd = usb_create_hcd(&isp116x_hc_driver, &op->dev, dev_name(&op->dev));
+ if (!hcd) {
+ ret = -ENOMEM;
+ goto err_irq_dispose;
+ }
+
+ /* this rsrc_start is bogus */
+ hcd->rsrc_start = addr.start;
+ isp116x = hcd_to_isp116x(hcd);
+ isp116x->data_reg = data_reg;
+ isp116x->addr_reg = addr_reg;
+ isp116x->board = board;
+ spin_lock_init(&isp116x->lock);
+ INIT_LIST_HEAD(&isp116x->async);
+
+ board->delay = isp116x_of_delay;
+ if (of_get_property(dn, "sel15Kres", NULL))
+ board->sel15Kres = 1;
+ if (of_get_property(dn, "oc_enable", NULL))
+ board->oc_enable = 1;
+ if (of_get_property(dn, "remote_wakeup_enable", NULL))
+ board->remote_wakeup_enable = 1;
+
+ if (of_get_property(dn, "int_act_high", NULL))
+ board->int_act_high = 1;
+ if (of_get_property(dn, "int_edge_triggered", NULL))
+ board->int_edge_triggered = 1;
+
+ if (board->int_edge_triggered)
+ irqflags = board->int_act_high ? IRQF_TRIGGER_RISING :
+ IRQF_TRIGGER_FALLING;
+ else
+ irqflags = board->int_act_high ? IRQF_TRIGGER_HIGH :
+ IRQF_TRIGGER_LOW;
+
+ ret = usb_add_hcd(hcd, irq, irqflags | IRQF_DISABLED);
+ if (ret)
+ goto err_put_hcd;
+
+ ret = create_debug_file(isp116x);
+ if (ret) {
+ ERR("Couldn't create debugfs entry\n");
+ goto err_remove_hcd;
+ }
+
+ return 0;
+
+ err_remove_hcd:
+ usb_remove_hcd(hcd);
+ err_put_hcd:
+ usb_put_hcd(hcd);
+ err_irq_dispose:
+ irq_dispose_mapping(irq);
+ err_unmap_data:
+ iounmap(data_reg);
+ err_release_data:
+ release_mem_region(data.start, resource_size(&data));
+ err_unmap_addr:
+ iounmap(addr_reg);
+ err_release_addr:
+ release_mem_region(addr.start, resource_size(&addr));
+ err_free_board:
+ kfree(board);
+ return ret;
+}
+
+static int isp116x_of_remove(struct platform_device *op)
+{
+ struct usb_hcd *hcd = dev_get_drvdata(&op->dev);
+ struct isp116x *isp116x;
+ struct resource res;
+
+ if (!hcd)
+ return 0;
+
+ dev_set_drvdata(&op->dev, NULL);
+
+ isp116x = hcd_to_isp116x(hcd);
+ remove_debug_file(isp116x);
+ usb_remove_hcd(hcd);
+
+ irq_dispose_mapping(hcd->irq);
+
+ iounmap(isp116x->data_reg);
+ (void) of_address_to_resource(op->dev.of_node, 0, &res);
+ release_mem_region(res.start, resource_size(&res));
+
+ iounmap(isp116x->addr_reg);
+ (void) of_address_to_resource(op->dev.of_node, 1, &res);
+ release_mem_region(res.start, resource_size(&res));
+
+ kfree(isp116x->board);
+ usb_put_hcd(hcd);
+
+ return 0;
+}
+
+static struct of_device_id isp116x_of_match[] = {
+ { .compatible = "isp116x-hcd", },
+ {},
+};
+
+static struct platform_driver isp116x_of_platform_driver = {
+ .probe = isp116x_of_probe,
+ .remove = isp116x_of_remove,
+ .driver = {
+ .name = "isp116x-hcd-of",
+ .owner = THIS_MODULE,
+ .of_match_table = isp116x_of_match,
+ },
+};
+
+static int __init isp116x_of_register(void)
+{
+ return platform_driver_register(&isp116x_of_platform_driver);
+}
+
+static void __exit isp116x_of_unregister(void)
+{
+ platform_driver_unregister(&isp116x_of_platform_driver);
+}
+
+MODULE_DEVICE_TABLE(of, isp116x_of_match);
+
+#else
+static inline int isp116x_of_register(void) { return 0; };
+static void isp116x_of_unregister(void) {};
+#endif /* CONFIG_USB_ISP116X_HCD_OF */
+
+/*-----------------------------------------------------------------*/
+
+static int __init isp116x_init(void)
+{
+ int ret;
+
+ if (usb_disabled())
+ return -ENODEV;
+
+ INFO("driver %s, %s\n", hcd_name, DRIVER_VERSION);
+ ret = isp116x_platform_register();
+ if (ret)
+ return ret;
+
+ ret = isp116x_of_register();
+ if (ret)
+ goto err_platform_unregister;
+
+ return 0;
+
+ err_platform_unregister:
+ isp116x_platform_unregister();
+ return ret;
+}
+
+module_init(isp116x_init);
+
+static void __exit isp116x_cleanup(void)
+{
+ isp116x_of_unregister();
+ isp116x_platform_unregister();
+}
+
+module_exit(isp116x_cleanup);
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -327,6 +327,24 @@ config USB_ISP116X_HCD
To compile this driver as a module, choose M here: the
module will be called isp116x-hcd.
+config USB_ISP116X_HCD_PLATFORM
+ bool "ISP116X support for controllers on platform bus"
+ depends on USB_ISP116X_HCD
+ default n if PPC_OF
+ default y
+ ---help---
+ Enables support for the ISP116x USB controller present on the
+ platform bus.
+
+config USB_ISP116X_HCD_OF
+ bool "ISP116X support for controllers on OF platform bus"
+ depends on USB_ISP116X_HCD && PPC_OF
+ default y if PPC_OF
+ default n
+ ---help---
+ Enables support for the ISP116x USB controller present on the
+ OpenFirmware platform bus.
+
config USB_ISP1760_HCD
tristate "ISP 1760 HCD support"
---help---
--- a/drivers/usb/host/isp116x.h
+++ b/drivers/usb/host/isp116x.h
@@ -354,21 +354,63 @@ struct isp116x_ep {
#define isp116x_check_platform_delay(h) 0
#endif
+#ifdef CONFIG_PPC
+static inline void isp116x_writew(u16 val, void __iomem *addr)
+{
+ writew(cpu_to_le16(val), addr);
+}
+
+static inline u16 isp116x_readw(void __iomem *addr)
+{
+ return le16_to_cpu(readw(addr));
+}
+
+static inline void isp116x_raw_writew(u16 val, void __iomem *addr)
+{
+ writew(cpu_to_le16(val), addr);
+}
+
+static inline u16 isp116x_raw_readw(void __iomem *addr)
+{
+ return le16_to_cpu(readw(addr));
+}
+#else
+static inline void isp116x_writew(u16 val, void __iomem *addr)
+{
+ writew(val, addr);
+}
+
+static inline u16 isp116x_readw(void __iomem *addr)
+{
+ return readw(addr);
+}
+
+static inline void isp116x_raw_writew(u16 val, void __iomem *addr)
+{
+ __raw_writew(val, addr);
+}
+
+static inline u16 isp116x_raw_readw(void __iomem *addr)
+{
+ return __raw_readw(addr);
+}
+#endif
+
static inline void isp116x_write_addr(struct isp116x *isp116x, unsigned reg)
{
- writew(reg & 0xff, isp116x->addr_reg);
+ isp116x_writew(reg & 0xff, isp116x->addr_reg);
isp116x_delay(isp116x, 300);
}
static inline void isp116x_write_data16(struct isp116x *isp116x, u16 val)
{
- writew(val, isp116x->data_reg);
+ isp116x_writew(val, isp116x->data_reg);
isp116x_delay(isp116x, 150);
}
static inline void isp116x_raw_write_data16(struct isp116x *isp116x, u16 val)
{
- __raw_writew(val, isp116x->data_reg);
+ isp116x_raw_writew(val, isp116x->data_reg);
isp116x_delay(isp116x, 150);
}
@@ -376,7 +418,7 @@ static inline u16 isp116x_read_data16(st
{
u16 val;
- val = readw(isp116x->data_reg);
+ val = isp116x_readw(isp116x->data_reg);
isp116x_delay(isp116x, 150);
return val;
}
@@ -385,16 +427,16 @@ static inline u16 isp116x_raw_read_data1
{
u16 val;
- val = __raw_readw(isp116x->data_reg);
+ val = isp116x_raw_readw(isp116x->data_reg);
isp116x_delay(isp116x, 150);
return val;
}
static inline void isp116x_write_data32(struct isp116x *isp116x, u32 val)
{
- writew(val & 0xffff, isp116x->data_reg);
+ isp116x_writew(val & 0xffff, isp116x->data_reg);
isp116x_delay(isp116x, 150);
- writew(val >> 16, isp116x->data_reg);
+ isp116x_writew(val >> 16, isp116x->data_reg);
isp116x_delay(isp116x, 150);
}
@@ -402,9 +444,9 @@ static inline u32 isp116x_read_data32(st
{
u32 val;
- val = (u32) readw(isp116x->data_reg);
+ val = (u32) isp116x_readw(isp116x->data_reg);
isp116x_delay(isp116x, 150);
- val |= ((u32) readw(isp116x->data_reg)) << 16;
+ val |= ((u32) isp116x_readw(isp116x->data_reg)) << 16;
isp116x_delay(isp116x, 150);
return val;
}
#
# Copyright (C) 2006-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=pxa
BOARDNAME:=Marvell/Intel PXA2xx
FEATURES:=squashfs broken
MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>
KERNEL_PATCHVER:=3.3
include $(INCLUDE_DIR)/target.mk
define Target/Description
Build images for PXA2xx systems, eg. Gumstix.
endef
KERNELNAME:=uImage
$(eval $(call BuildTarget))
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_ARCH_GUMSTIX=y
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
CONFIG_ARCH_HAS_CPUFREQ=y
CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
# CONFIG_ARCH_LUBBOCK is not set
CONFIG_ARCH_MTD_XIP=y
CONFIG_ARCH_NR_GPIO=0
CONFIG_ARCH_PXA=y
# CONFIG_ARCH_PXA_ESERIES is not set
# CONFIG_ARCH_PXA_IDP is not set
# CONFIG_ARCH_PXA_PALM is not set
CONFIG_ARCH_REQUIRE_GPIOLIB=y
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ARCH_VIPER is not set
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_ARM=y
# CONFIG_ARM_APPENDED_DTB is not set
# CONFIG_ARM_CPU_SUSPEND is not set
CONFIG_ARM_L1_CACHE_SHIFT=5
CONFIG_ARM_NR_BANKS=8
CONFIG_ARM_PATCH_PHYS_VIRT=y
# CONFIG_ARM_THUMB is not set
# CONFIG_ARPD is not set
CONFIG_ATAGS=y
CONFIG_AUTO_ZRELADDR=y
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CACHE_L2X0 is not set
CONFIG_CACHE_XSC3L2=y
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLKSRC_MMIO=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"
CONFIG_CMDLINE_FROM_BOOTLOADER=y
CONFIG_CPU_32v5=y
CONFIG_CPU_ABRT_EV5T=y
# CONFIG_CPU_BPREDICT_DISABLE is not set
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_CPU_PABRT_LEGACY=y
CONFIG_CPU_PXA300=y
CONFIG_CPU_TLB_V4WBI=y
CONFIG_CPU_USE_DOMAINS=y
CONFIG_CPU_XSC3=y
CONFIG_CPU_XSCALE=y
CONFIG_DEBUG_BUGVERBOSE=y
CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
# CONFIG_DEBUG_USER is not set
CONFIG_DTC=y
CONFIG_ENABLE_MUST_CHECK=y
# CONFIG_EPOLL is not set
CONFIG_FRAME_POINTER=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_IDLE_POLL_SETUP=y
CONFIG_GENERIC_IO=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GENERIC_SMP_IDLE_THREAD=y
CONFIG_GENERIC_STRNCPY_FROM_USER=y
CONFIG_GENERIC_STRNLEN_USER=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_DEVRES=y
CONFIG_GPIO_PXA=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
CONFIG_HAVE_ARCH_JUMP_LABEL=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_PFN_VALID=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_HAVE_ARCH_TRACEHOOK=y
# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
CONFIG_HAVE_BPF_JIT=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_CONTEXT_TRACKING=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_DEBUG_KMEMLEAK=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_DMA_ATTRS=y
CONFIG_HAVE_DMA_CONTIGUOUS=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_HAVE_GENERIC_HARDIRQS=y
CONFIG_HAVE_IDE=y
CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_NET_DSA=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_HAVE_PWM=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_UID16=y
CONFIG_HZ_PERIODIC=y
CONFIG_IO_36=y
CONFIG_IRQCHIP=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_WORK=y
CONFIG_IWMMXT=y
CONFIG_KTIME_SCALAR=y
# CONFIG_MACH_ARCOM_ZEUS is not set
# CONFIG_MACH_ARMCORE is not set
# CONFIG_MACH_BALLOON3 is not set
# CONFIG_MACH_CAPC7117 is not set
# CONFIG_MACH_CM_X300 is not set
# CONFIG_MACH_COLIBRI is not set
# CONFIG_MACH_COLIBRI300 is not set
# CONFIG_MACH_COLIBRI320 is not set
# CONFIG_MACH_CSB726 is not set
# CONFIG_MACH_EM_X270 is not set
# CONFIG_MACH_EXEDA is not set
# CONFIG_MACH_GUMSTIX_F is not set
CONFIG_MACH_GUMSTIX_VERDEX=y
# CONFIG_MACH_H4700 is not set
# CONFIG_MACH_H5000 is not set
# CONFIG_MACH_HIMALAYA is not set
# CONFIG_MACH_ICONTROL is not set
# CONFIG_MACH_INTELMOTE2 is not set
# CONFIG_MACH_LITTLETON is not set
# CONFIG_MACH_LOGICPD_PXA270 is not set
# CONFIG_MACH_MAGICIAN is not set
# CONFIG_MACH_MAINSTONE is not set
# CONFIG_MACH_MIOA701 is not set
# CONFIG_MACH_MP900C is not set
# CONFIG_MACH_PCM027 is not set
CONFIG_MACH_PXA3XX_DT=y
# CONFIG_MACH_RAUMFELD_CONNECTOR is not set
# CONFIG_MACH_RAUMFELD_RC is not set
# CONFIG_MACH_RAUMFELD_SPEAKER is not set
# CONFIG_MACH_SAAR is not set
# CONFIG_MACH_STARGATE2 is not set
# CONFIG_MACH_TAVOREVB is not set
# CONFIG_MACH_VPAC270 is not set
# CONFIG_MACH_XCEP is not set
# CONFIG_MACH_ZIPIT2 is not set
# CONFIG_MACH_ZYLONITE300 is not set
# CONFIG_MACH_ZYLONITE320 is not set
CONFIG_MDIO_BOARDINFO=y
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_PXA=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
# CONFIG_MTD_CFI_AMDSTD is not set
CONFIG_MTD_CFI_GEOMETRY=y
# CONFIG_MTD_CFI_I2 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
CONFIG_MTD_OF_PARTS=y
CONFIG_MTD_PHYSMAP=y
# CONFIG_MTD_PHYSMAP_OF is not set
CONFIG_MTD_PXA2XX=y
# CONFIG_MTD_XIP is not set
CONFIG_MULTI_IRQ_HANDLER=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_KUSER_HELPERS=y
CONFIG_NEED_MACH_GPIO_H=y
CONFIG_NEED_PER_CPU_KM=y
CONFIG_OF=y
CONFIG_OF_ADDRESS=y
CONFIG_OF_DEVICE=y
CONFIG_OF_EARLY_FLATTREE=y
CONFIG_OF_FLATTREE=y
CONFIG_OF_GPIO=y
CONFIG_OF_IRQ=y
CONFIG_OF_MDIO=y
CONFIG_OF_MTD=y
CONFIG_OF_NET=y
CONFIG_OLD_SIGACTION=y
CONFIG_OLD_SIGSUSPEND3=y
CONFIG_OUTER_CACHE=y
# CONFIG_PACKET is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xC0000000
# CONFIG_PCI_SYSCALL is not set
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PHYLIB=y
CONFIG_PLAT_PXA=y
CONFIG_POWER_SUPPLY=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_PXA27x=y
CONFIG_PXA3xx=y
# CONFIG_PXA_EZX is not set
# CONFIG_PXA_SHARPSL is not set
# CONFIG_RCU_STALL_COMMON is not set
# CONFIG_SA1100_WATCHDOG is not set
CONFIG_SCHED_HRTICK=y
# CONFIG_SCSI_DMA is not set
# CONFIG_SERIAL_8250 is not set
CONFIG_SERIAL_PXA=y
CONFIG_SERIAL_PXA_CONSOLE=y
CONFIG_SMSC911X=y
# CONFIG_SMSC911X_ARCH_HOOKS is not set
CONFIG_SPARSE_IRQ=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_TRIZEPS_PXA is not set
CONFIG_UID16=y
CONFIG_UIDGID_CONVERTED=y
CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h"
# CONFIG_USB_ARCH_HAS_EHCI is not set
# CONFIG_USB_ARCH_HAS_XHCI is not set
CONFIG_USE_OF=y
CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VLAN_8021Q is not set
CONFIG_XSCALE_PMU=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZONE_DMA_FLAG=0
CONFIG_ALIGNMENT_TRAP=y
CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
CONFIG_ARCH_GUMSTIX=y
CONFIG_ARCH_HAS_CPUFREQ=y
CONFIG_ARCH_HAS_CPU_IDLE_WAIT=y
# CONFIG_ARCH_LUBBOCK is not set
CONFIG_ARCH_MTD_XIP=y
CONFIG_ARCH_NR_GPIO=0
CONFIG_ARCH_PXA=y
# CONFIG_ARCH_PXA_ESERIES is not set
# CONFIG_ARCH_PXA_IDP is not set
# CONFIG_ARCH_PXA_PALM is not set
# CONFIG_ARCH_PXA_V7 is not set
CONFIG_ARCH_REQUIRE_GPIOLIB=y
# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
CONFIG_ARCH_SUSPEND_POSSIBLE=y
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
# CONFIG_ARCH_VIPER is not set
CONFIG_ARM=y
# CONFIG_ARM_CPU_SUSPEND is not set
CONFIG_ARM_L1_CACHE_SHIFT=5
CONFIG_ARM_NR_BANKS=8
CONFIG_ARM_PATCH_PHYS_VIRT=y
# CONFIG_ARM_THUMB is not set
# CONFIG_ARPD is not set
CONFIG_AUTO_ZRELADDR=y
# CONFIG_BLK_DEV_IDEDMA is not set
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CACHE_L2X0 is not set
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLKSRC_MMIO=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"
CONFIG_CMDLINE_FROM_BOOTLOADER=y
CONFIG_CPU_32v5=y
CONFIG_CPU_ABRT_EV5T=y
CONFIG_CPU_CACHE_VIVT=y
CONFIG_CPU_CP15=y
CONFIG_CPU_CP15_MMU=y
CONFIG_CPU_HAS_PMU=y
CONFIG_CPU_PABRT_LEGACY=y
CONFIG_CPU_TLB_V4WBI=y
CONFIG_CPU_USE_DOMAINS=y
CONFIG_CPU_XSCALE=y
CONFIG_DEBUG_BUGVERBOSE=y
# CONFIG_DEBUG_LL_UART_NONE is not set
# CONFIG_DEBUG_USER is not set
CONFIG_ENABLE_MUST_CHECK=y
# CONFIG_EPOLL is not set
CONFIG_FRAME_POINTER=y
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
CONFIG_GENERIC_GPIO=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_GENERIC_PCI_IOMAP=y
CONFIG_GPIOLIB=y
CONFIG_GPIO_PXA=y
CONFIG_HARDIRQS_SW_RESEND=y
CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAVE_AOUT=y
CONFIG_HAVE_ARCH_KGDB=y
CONFIG_HAVE_ARCH_PFN_VALID=y
CONFIG_HAVE_CLK=y
CONFIG_HAVE_C_RECORDMCOUNT=y
CONFIG_HAVE_DMA_API_DEBUG=y
CONFIG_HAVE_DYNAMIC_FTRACE=y
CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_HAVE_GENERIC_HARDIRQS=y
CONFIG_HAVE_IDE=y
CONFIG_HAVE_IRQ_WORK=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_HAVE_MEMBLOCK=y
CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_PROC_CPU=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_SCHED_CLOCK=y
CONFIG_HAVE_SPARSE_IRQ=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_PXA_SLAVE=y
CONFIG_IWMMXT=y
CONFIG_KTIME_SCALAR=y
# CONFIG_MACH_ARCOM_ZEUS is not set
# CONFIG_MACH_ARMCORE is not set
# CONFIG_MACH_BALLOON3 is not set
# CONFIG_MACH_CAPC7117 is not set
# CONFIG_MACH_CM_X300 is not set
# CONFIG_MACH_COLIBRI is not set
# CONFIG_MACH_COLIBRI300 is not set
# CONFIG_MACH_COLIBRI320 is not set
# CONFIG_MACH_CSB726 is not set
# CONFIG_MACH_EM_X270 is not set
# CONFIG_MACH_EXEDA is not set
# CONFIG_MACH_GUMSTIX_F is not set
CONFIG_MACH_GUMSTIX_VERDEX=y
# CONFIG_MACH_H4700 is not set
# CONFIG_MACH_H5000 is not set
# CONFIG_MACH_HIMALAYA is not set
# CONFIG_MACH_ICONTROL is not set
# CONFIG_MACH_INTELMOTE2 is not set
# CONFIG_MACH_LITTLETON is not set
# CONFIG_MACH_LOGICPD_PXA270 is not set
# CONFIG_MACH_MAGICIAN is not set
# CONFIG_MACH_MAINSTONE is not set
# CONFIG_MACH_MIOA701 is not set
# CONFIG_MACH_MP900C is not set
# CONFIG_MACH_PCM027 is not set
# CONFIG_MACH_RAUMFELD_CONNECTOR is not set
# CONFIG_MACH_RAUMFELD_RC is not set
# CONFIG_MACH_RAUMFELD_SPEAKER is not set
# CONFIG_MACH_SAAR is not set
# CONFIG_MACH_STARGATE2 is not set
# CONFIG_MACH_TAVOREVB is not set
# CONFIG_MACH_VPAC270 is not set
# CONFIG_MACH_XCEP is not set
# CONFIG_MACH_ZIPIT2 is not set
# CONFIG_MACH_ZYLONITE300 is not set
# CONFIG_MACH_ZYLONITE320 is not set
CONFIG_MDIO_BOARDINFO=y
# CONFIG_MFD_T7L66XB is not set
CONFIG_MMC=y
CONFIG_MMC_BLOCK=y
CONFIG_MMC_PXA=y
CONFIG_MTD_CFI_ADV_OPTIONS=y
# CONFIG_MTD_CFI_AMDSTD is not set
CONFIG_MTD_CFI_GEOMETRY=y
# CONFIG_MTD_CFI_I2 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
CONFIG_MTD_PHYSMAP=y
CONFIG_MTD_PXA2XX=y
# CONFIG_MTD_XIP is not set
CONFIG_MULTI_IRQ_HANDLER=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_PER_CPU_KM=y
# CONFIG_PACKET is not set
CONFIG_PAGEFLAGS_EXTENDED=y
CONFIG_PAGE_OFFSET=0xC0000000
# CONFIG_PATA_PXA is not set
# CONFIG_PCI_SYSCALL is not set
CONFIG_PCMCIA_LOAD_CIS=y
CONFIG_PERF_USE_VMALLOC=y
CONFIG_PHYLIB=y
CONFIG_PLAT_PXA=y
# CONFIG_PREEMPT_RCU is not set
CONFIG_PXA27x=y
# CONFIG_PXA_EZX is not set
# CONFIG_PXA_SHARPSL is not set
# CONFIG_SCSI_MULTI_LUN is not set
# CONFIG_SCSI_PROC_FS is not set
# CONFIG_SERIAL_8250 is not set
CONFIG_SERIAL_PXA=y
CONFIG_SERIAL_PXA_CONSOLE=y
CONFIG_SMSC911X=y
# CONFIG_SMSC911X_ARCH_HOOKS is not set
CONFIG_SPARSE_IRQ=y
CONFIG_SPLIT_PTLOCK_CPUS=999999
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
# CONFIG_TRIZEPS_PXA is not set
CONFIG_UID16=y
CONFIG_VECTORS_BASE=0xffff0000
# CONFIG_VLAN_8021Q is not set
CONFIG_XSCALE_PMU=y
CONFIG_XZ_DEC_ARM=y
CONFIG_XZ_DEC_BCJ=y
CONFIG_ZBOOT_ROM_BSS=0x0
CONFIG_ZBOOT_ROM_TEXT=0x0
CONFIG_ZONE_DMA_FLAG=0
#
# Copyright (C) 2008-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
define Image/BuildKernel
cp $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
endef
# Build a fake flash image for usage in Qemu
define Image/Build/Gumstix
dd if=/dev/zero bs=128k count=256 of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-qemu-flash.img
dd if=$(BIN_DIR)/openwrt-pxa-gumstix-u-boot.bin conv=notrunc bs=128k \
of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-qemu-flash.img
dd if=$(KDIR)/root.$(1) conv=notrunc bs=128k seek=2 \
of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-qemu-flash.img
dd if=$(KDIR)/uImage conv=notrunc bs=128k seek=248 \
of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-qemu-flash.img
endef
define Image/Build
$(call Image/Build/$(1),$(1))
$(call Image/Build/$(PROFILE),$(1))
endef
define Image/Build/jffs2-64k
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=64k conv=sync
endef
define Image/Build/jffs2-128k
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=128k conv=sync
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img bs=128k conv=sync
endef
$(eval $(call BuildImage))
From eb92a178eceae4e5d18bbb442b8e44cb88457d60 Mon Sep 17 00:00:00 2001
From: Joseph Kortje <jpktech@rogers.com>
Date: Wed, 28 Oct 2009 21:25:57 -0400
Subject: [PATCH] [ARM] Gumstix Verdex LCD config options
add options to Kconfig for Verdex LCD support
Signed-off-by: Bobby Powers <bobbypowers@gmail.com>
---
drivers/video/Kconfig | 31 +++++++++++++++++++++++++++++++
1 files changed, 31 insertions(+), 0 deletions(-)
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1905,6 +1905,37 @@ config FB_PXA
say M here and read <file:Documentation/kbuild/modules.txt>.
If unsure, say N.
+choice
+ depends on FB_PXA
+ prompt "LCD Panel"
+ default FB_PXA_SAMSUNG_LTE430WQ_F0C
+
+config FB_PXA_ALPS_CDOLLAR
+ boolean "Chris Dollar's ALPS screen"
+ ---help---
+ Enable definitions (over-ridable on the kernel command line if
+ "PXA LCD command line parameters" is also selected) for an ALPS
+ screen which Chris Dollar uses
+
+config FB_PXA_SHARP_LQ043_PSP
+ boolean "SHARP LQ043... series"
+ ---help---
+ Enable definitions (over-ridable on the kernel command line if
+ "PXA LCD command line parameters" is also selected) for a SHARP
+ LQ043... screen, such as the one used by the PSP. These screens are
+ the ones normally sold by gumstix with its boards.
+
+config FB_PXA_SAMSUNG_LTE430WQ_F0C
+ boolean "Samsung LTE430WQ-F0C (standard gumstix LCD)"
+ ---help---
+ Enable definitions for a Samsung LTE430WQ-F0C LCD panel, such as the ones resold
+ by gumstix for use with their "LCD-Ready" boards.
+
+config FB_PXA_NONEOFTHEABOVE
+ boolean "None of the above"
+
+endchoice
+
config FB_PXA_OVERLAY
bool "Support PXA27x/PXA3xx Overlay(s) as framebuffer"
From adb6abbe4e3bc17c20cdc70e4a4357f1633d4970 Mon Sep 17 00:00:00 2001
From: Joseph Kortje <jpktech@rogers.com>
Date: Wed, 28 Oct 2009 21:49:11 -0400
Subject: [PATCH] [ARM] gumstix.h: Verdex Pro support
Added a bunch of ifdefs to support both original gumstix boards
as well as the Verdex Pro in gumstix.h
Signed-off-by: Bobby Powers <bobbypowers@gmail.com>
---
arch/arm/mach-pxa/include/mach/gumstix.h | 160 ++++++++++++++++++++++++------
1 files changed, 130 insertions(+), 30 deletions(-)
--- a/arch/arm/mach-pxa/include/mach/gumstix.h
+++ b/arch/arm/mach-pxa/include/mach/gumstix.h
@@ -6,6 +6,9 @@
* published by the Free Software Foundation.
*/
+#if !defined(__ASM_ARCH_MFP_PXA27X_H) && !defined(__ASM_ARCH_MFP_PXA25X_H)
+ #error You need to include either mfp-pxa27x.h or mfp-pxa25x.h
+#endif
/* BTRESET - Reset line to Bluetooth module, active low signal. */
#define GPIO_GUMSTIX_BTRESET 7
@@ -20,9 +23,18 @@ this moves to GPIO17 and GPIO37. */
/* GPIOx - Connects to USB D+ and used as a pull-up after GPIOn
has detected a cable insertion; driven low otherwise. */
+#ifndef CONFIG_MACH_GUMSTIX_VERDEX
+
#define GPIO_GUMSTIX_USB_GPIOn 35
#define GPIO_GUMSTIX_USB_GPIOx 41
+#else
+
+#define GPIO_GUMSTIX_USB_GPIOn 100
+#define GPIO_GUMSTIX_USB_GPIOx 27
+
+#endif
+
/* usb state change */
#define GUMSTIX_USB_INTR_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_USB_GPIOn)
@@ -42,48 +54,136 @@ has detected a cable insertion; driven l
* ETH_RST provides a hardware reset line to the ethernet chip
* ETH is the IRQ line in from the ethernet chip to the PXA
*/
+#ifndef CONFIG_MACH_GUMSTIX_VERDEX
#define GPIO_GUMSTIX_ETH0_RST 80
-#define GPIO_GUMSTIX_ETH0_RST_MD (GPIO_GUMSTIX_ETH0_RST | GPIO_OUT)
+#define GPIO_GUMSTIX_ETH0 36
+#else
+#define GPIO_GUMSTIX_ETH0_RST 107
+#define GPIO_GUMSTIX_ETH0 99
+#endif
#define GPIO_GUMSTIX_ETH1_RST 52
-#define GPIO_GUMSTIX_ETH1_RST_MD (GPIO_GUMSTIX_ETH1_RST | GPIO_OUT)
+#define GPIO_GUMSTIX_ETH1 27
-#define GPIO_GUMSTIX_ETH0 36
+#define GPIO_GUMSTIX_ETH0_RST_MD (GPIO_GUMSTIX_ETH0_RST | GPIO_OUT)
+#define GPIO_GUMSTIX_ETH1_RST_MD (GPIO_GUMSTIX_ETH1_RST | GPIO_OUT)
#define GPIO_GUMSTIX_ETH0_MD (GPIO_GUMSTIX_ETH0 | GPIO_IN)
-#define GUMSTIX_ETH0_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0)
-#define GPIO_GUMSTIX_ETH1 27
#define GPIO_GUMSTIX_ETH1_MD (GPIO_GUMSTIX_ETH1 | GPIO_IN)
-#define GUMSTIX_ETH1_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH1)
-
-/* CF reset line */
-#define GPIO8_RESET 8
+#define GUMSTIX_ETH0_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH0)
+#define GUMSTIX_ETH1_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_ETH1)
-/* CF slot 0 */
-#define GPIO4_nBVD1 4
-#define GPIO4_nSTSCHG GPIO4_nBVD1
-#define GPIO11_nCD 11
-#define GPIO26_PRDY_nBSY 26
-#define GUMSTIX_S0_nSTSCHG_IRQ PXA_GPIO_TO_IRQ(GPIO4_nSTSCHG)
-#define GUMSTIX_S0_nCD_IRQ PXA_GPIO_TO_IRQ(GPIO11_nCD)
-#define GUMSTIX_S0_PRDY_nBSY_IRQ PXA_GPIO_TO_IRQ(GPIO26_PRDY_nBSY)
+ /* CF reset line */
+#define GPIO8_CF_RESET 8
+#define GPIO97_CF_RESET 97
+#define GPIO110_CF_RESET 110
+
+#ifndef CONFIG_MACH_GUMSTIX_VERDEX
+#define GPIO_GUMSTIX_CF_RESET GPIO8_CF_RESET
+#else
+#define GPIO_GUMSTIX_CF_RESET GPIO97_CF_RESET
+#endif
+
+#define GPIO_GUMSTIX_CF_OLD_RESET GPIO110_CF_RESET
+
+/* CF signals shared by both sockets */
+#define GPIO_GUMSTIX_nPOE 48
+#define GPIO_GUMSTIX_nPWE 49
+#define GPIO_GUMSTIX_nPIOR 50
+#define GPIO_GUMSTIX_nPIOW 51
+
+#ifndef CONFIG_MACH_GUMSTIX_VERDEX
+#define GPIO_GUMSTIX_nPCE_1 52
+#define GPIO_GUMSTIX_nPCE_2 53
+#define GPIO_GUMSTIX_pSKTSEL 54
+#else
+#define GPIO_GUMSTIX_nPCE_1 102
+#define GPIO_GUMSTIX_nPCE_2 105
+#define GPIO_GUMSTIX_pSKTSEL 79
+#endif
+
+#define GPIO_GUMSTIX_nPREG 55
+#define GPIO_GUMSTIX_nPWAIT 56
+#define GPIO_GUMSTIX_nIOIS16 57
+
+/* Pin mode definitions correspond to mfp-pxa2[57]x.h */
+#define GPIO_GUMSTIX_nPOE_MD GPIO48_nPOE
+#define GPIO_GUMSTIX_nPWE_MD GPIO49_nPWE
+#define GPIO_GUMSTIX_nPIOR_MD GPIO50_nPIOR
+#define GPIO_GUMSTIX_nPIOW_MD GPIO51_nPIOW
+
+#ifndef CONFIG_MACH_GUMSTIX_VERDEX
+#define GPIO_GUMSTIX_nPCE_1_MD GPIO52_nPCE_1
+#define GPIO_GUMSTIX_nPCE_2_MD GPIO53_nPCE_2
+#define GPIO_GUMSTIX_pSKTSEL_MD GPIO54_pSKTSEL
+#else
+#define GPIO_GUMSTIX_nPCE_1_MD GPIO102_nPCE_1
+#define GPIO_GUMSTIX_nPCE_2_MD GPIO105_nPCE_2
+#define GPIO_GUMSTIX_pSKTSEL_MD GPIO79_pSKTSEL
+#endif
+
+#define GPIO_GUMSTIX_nPREG_MD GPIO55_nPREG
+#define GPIO_GUMSTIX_nPWAIT_MD GPIO56_nPWAIT
+#define GPIO_GUMSTIX_nIOIS16_MD GPIO57_nIOIS16
+
+ /* CF slot 0 */
+#define GPIO4_nBVD1_0 4
+#define GPIO4_nSTSCHG_0 GPIO4_nBVD1_0
+#define GPIO11_nCD_0 11
+#define GPIO26_PRDY_nBSY_0 26
+
+#define GPIO111_nBVD1_0 111
+#define GPIO111_nSTSCHG_0 GPIO111_nBVD1_0
+#define GPIO104_nCD_0 104
+#define GPIO96_PRDY_nBSY_0 96
+#define GPIO109_PRDY_nBSY_0 109
+
+#ifndef CONFIG_MACH_GUMSTIX_VERDEX
+#define GPIO_GUMSTIX_nBVD1_0 GPIO4_nBVD1_0
+#define GPIO_GUMSTIX_nSTSCHG_0 GPIO4_nSTSCHG_0
+#define GPIO_GUMSTIX_nCD_0 GPIO11_nCD_0
+#define GPIO_GUMSTIX_PRDY_nBSY_0 GPIO26_PRDY_nBSY_0
+#else
+#define GPIO_GUMSTIX_nBVD1_0 GPIO111_nBVD1_0
+#define GPIO_GUMSTIX_nSTSCHG_0 GPIO111_nSTSCHG_0
+#define GPIO_GUMSTIX_nCD_0 GPIO104_nCD_0
+#define GPIO_GUMSTIX_PRDY_nBSY_0 GPIO96_PRDY_nBSY_0
+#endif
+
+#define GPIO_GUMSTIX_PRDY_nBSY_0_OLD GPIO109_PRDY_nBSY_0
+#define GUMSTIX_S0_PRDY_nBSY_OLD_IRQ PXA_GPIO_TO_IRQ(GPIO109_PRDY_nBSY_0)
+
+#define GUMSTIX_S0_nSTSCHG_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_nSTSCHG_0)
+#define GUMSTIX_S0_nCD_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_nCD_0)
+#define GUMSTIX_S0_PRDY_nBSY_IRQ PXA_GPIO_TO_IRQ(GPIO_GUMSTIX_PRDY_nBSY_0)
/* CF slot 1 */
-#define GPIO18_nBVD1 18
-#define GPIO18_nSTSCHG GPIO18_nBVD1
-#define GPIO36_nCD 36
-#define GPIO27_PRDY_nBSY 27
-#define GUMSTIX_S1_nSTSCHG_IRQ PXA_GPIO_TO_IRQ(GPIO18_nSTSCHG)
-#define GUMSTIX_S1_nCD_IRQ PXA_GPIO_TO_IRQ(GPIO36_nCD)
-#define GUMSTIX_S1_PRDY_nBSY_IRQ PXA_GPIO_TO_IRQ(GPIO27_PRDY_nBSY)
-
-/* CF GPIO line modes */
-#define GPIO4_nSTSCHG_MD (GPIO4_nSTSCHG | GPIO_IN)
-#define GPIO8_RESET_MD (GPIO8_RESET | GPIO_OUT)
-#define GPIO11_nCD_MD (GPIO11_nCD | GPIO_IN)
-#define GPIO18_nSTSCHG_MD (GPIO18_nSTSCHG | GPIO_IN)
-#define GPIO26_PRDY_nBSY_MD (GPIO26_PRDY_nBSY | GPIO_IN)
-#define GPIO27_PRDY_nBSY_MD (GPIO27_PRDY_nBSY | GPIO_IN)
-#define GPIO36_nCD_MD (GPIO36_nCD | GPIO_IN)
+#define GPIO18_nBVD1_1 18
+#define GPIO18_nSTSCHG_1 GPIO18_nBVD1_1
+#define GPIO36_nCD_1 36
+#define GPIO27_PRDY_nBSY_1 27
+
+#define GPIO_GUMSTIX_nBVD1_1 GPIO18_nBVD1_1
+#define GPIO_GUMSTIX_nSTSCHG_1 GPIO18_nSTSCHG_1
+#define GPIO_GUMSTIX_nCD_1 GPIO36_nCD_1
+#define GPIO_GUMSTIX_PRDY_nBSY_1 GPIO27_PRDY_nBSY_1
+
+#define GUMSTIX_S1_nSTSCHG_IRQ PXA_GPIO_TO_IRQ(GPIO18_nSTSCHG_1)
+#define GUMSTIX_S1_nCD_IRQ PXA_GPIO_TO_IRQ(GPIO36_nCD_1)
+#define GUMSTIX_S1_PRDY_nBSY_IRQ PXA_GPIO_TO_IRQ(GPIO27_PRDY_nBSY_1)
+
+/* CF GPIO line modes - correspond to mfp-pxa2[57]x.h */
+#define GPIO_GUMSTIX_CF_RESET_MD (GPIO_GUMSTIX_CF_RESET | GPIO_OUT)
+#define GPIO_GUMSTIX_CF_OLD_RESET_MD (GPIO_GUMSTIX_CF_OLD_RESET | GPIO_OUT)
+
+#define GPIO_GUMSTIX_nSTSCHG_0_MD GPIO111_GPIO
+#define GPIO_GUMSTIX_nCD_0_MD GPIO104_GPIO
+
+#define GPIO_GUMSTIX_PRDY_nBSY_0_MD GPIO96_GPIO
+#define GPIO_GUMSTIX_PRDY_nBSY_0_OLD_MD GPIO109_GPIO
+
+#define GPIO_GUMSTIX_nSTSCHG_1_MD GPIO18_GPIO
+#define GPIO_GUMSTIX_nCD_1_MD GPIO36_GPIO
+#define GPIO_GUMSTIX_PRDY_nBSY_1_MD GPIO27_GPIO
/* for expansion boards that can't be programatically detected */
extern int am200_init(void);
From 7645a459feb02f7aae4c3a5724b7800495d1b659 Mon Sep 17 00:00:00 2001
From: Bobby Powers <bobbypowers@gmail.com>
Date: Wed, 28 Oct 2009 22:41:31 -0400
Subject: [PATCH] [ARM] smsc911x: Verdex Pro support
Basically Joseph Kortje's patch, cleaned up to apply to Linus's
tree. Some of the smsc911x.c had been applied already
Signed-off-by: Bobby Powers <bobbypowers@gmail.com>
---
drivers/net/smsc911x.c | 50 +++++++++++++++++++++++++++++++++++++--------
drivers/net/smsc911x.h | 2 +-
include/linux/smsc911x.h | 11 ++++++++++
3 files changed, 53 insertions(+), 10 deletions(-)
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -60,6 +60,7 @@
#include <linux/of_device.h>
#include <linux/of_gpio.h>
#include <linux/of_net.h>
+#include <asm/system_info.h>
#include "smsc911x.h"
#define SMSC_CHIPNAME "smsc911x"
@@ -1514,7 +1515,7 @@ static int smsc911x_open(struct net_devi
SMSC_WARN(pdata, ifup,
"Timed out waiting for EEPROM busy bit to clear");
- smsc911x_reg_write(pdata, GPIO_CFG, 0x70070000);
+ smsc911x_reg_write(pdata, GPIO_CFG, GPIO_CFG_LED1_EN_ | GPIO_CFG_LED2_EN_ | (1 << 20));
/* The soft reset above cleared the device's MAC address,
* restore it from local copy (set in probe) */
@@ -1525,8 +1526,8 @@ static int smsc911x_open(struct net_devi
/* Initialise irqs, but leave all sources disabled */
smsc911x_disable_irq_chip(dev);
- /* Set interrupt deassertion to 100uS */
- intcfg = ((10 << 24) | INT_CFG_IRQ_EN_);
+ /* Set interrupt deassertion to 22*10uS */
+ intcfg = ((22 << 24) | INT_CFG_IRQ_EN_);
if (pdata->config.irq_polarity) {
SMSC_TRACE(pdata, ifup, "irq polarity: active high");
@@ -1552,7 +1553,7 @@ static int smsc911x_open(struct net_devi
temp |= INT_EN_SW_INT_EN_;
smsc911x_reg_write(pdata, INT_EN, temp);
- timeout = 1000;
+ timeout = 2000;
while (timeout--) {
if (pdata->software_irq_signal)
break;
@@ -2370,6 +2371,38 @@ static inline int smsc911x_probe_config_
}
#endif /* CONFIG_OF */
+static inline unsigned int is_gumstix_oui(u8 *addr)
+{
+ return (addr[0] == 0x00 && addr[1] == 0x15 && addr[2] == 0xC9);
+}
+
+/**
+ * gen_serial_ether_addr - Generate software assigned Ethernet address
+ * based on the system_serial number
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Generate an Ethernet address (MAC) that is not multicast
+ * and has the local assigned bit set, keyed on the system_serial
+ */
+static inline void gen_serial_ether_addr(u8 *addr)
+{
+ static u8 ether_serial_digit = 0;
+ addr [0] = system_serial_high >> 8;
+ addr [1] = system_serial_high;
+ addr [2] = system_serial_low >> 24;
+ addr [3] = system_serial_low >> 16;
+ addr [4] = system_serial_low >> 8;
+ addr [5] = (system_serial_low & 0xc0) | /* top bits are from system serial */
+ (1 << 4) | /* 2 bits identify interface type 1=ether, 2=usb, 3&4 undef */
+ ((ether_serial_digit++) & 0x0f); /* 15 possible interfaces of each type */
+
+ if(!is_gumstix_oui(addr))
+ {
+ addr [0] &= 0xfe; /* clear multicast bit */
+ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
+ }
+}
+
static int smsc911x_drv_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
@@ -2516,11 +2549,11 @@ static int smsc911x_drv_probe(struct pla
SMSC_TRACE(pdata, probe,
"Mac Address is read from LAN911x EEPROM");
} else {
- /* eeprom values are invalid, generate random MAC */
- eth_hw_addr_random(dev);
+ /* eeprom values are invalid, generate MAC from serial number */
+ gen_serial_ether_addr(dev->dev_addr);
smsc911x_set_hw_mac_address(pdata, dev->dev_addr);
SMSC_TRACE(pdata, probe,
- "MAC Address is set to eth_random_addr");
+ "MAC Address is derived from system serial number");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment