kernel: add arm7 multiplatform kernel.

not booting on panda yet.
This commit is contained in:
Arne Fitzenreiter
2013-09-15 18:41:16 +02:00
parent d1a84dd38d
commit 7284262a5e
13 changed files with 8908 additions and 121 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
#boot/ipfirerd-KVER-kirkwood.img
#boot/ipfirerd-KVER-omap.img
#boot/ipfirerd-KVER-multi.img
#boot/uInit-ipfire-kirkwood
#boot/uInit-ipfire-omap
#boot/uInit-ipfire-multi
etc/dracut.conf
etc/dracut.conf.d
#etc/dracut.conf.d/dracut.conf

View File

@@ -1,6 +1,7 @@
boot/System.map-KVER-ipfire-kirkwood
#boot/System.map-ipfire-kirkwood
boot/config-KVER-ipfire-kirkwood
boot/dtb-KVER-ipfire-kirkwood
boot/uImage-ipfire-kirkwood
boot/vmlinuz-KVER-ipfire-kirkwood
etc/modprobe.d/framebuffer

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,4 +1,5 @@
fatload mmc 0:1 0x80000000 uImage-ipfire-omap
fatload mmc 0:1 0x81600000 uInit-ipfire-omap
fatload mmc 0:1 0x82000000 zImage-ipfire-multi
fatload mmc 0:1 0x83600000 uInit-ipfire-multi
fatload mmc 0:1 ${ftdaddr} omap4-${board_name}.dtb
setenv bootargs vram=32M console=tty1 rootwait smsc95xx.macaddr=$usbethaddr root=/dev/mmcblk0p3 ro
bootm 0x80000000 0x81600000
bootz 0x82000000 0x83600000 ${ftdaddr}

View File

@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2011 IPFire Team <info@ipfire.org> #
# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -95,9 +95,10 @@ ifeq "$(MACHINE_TYPE)" "arm"
# kirkwood kernel
/sbin/dracut --force --verbose --strip /boot/ipfirerd-$(KVER)-kirkwood.img $(KVER)-ipfire-kirkwood
cd /boot && mkimage -A arm -T ramdisk -C lzma -d ipfirerd-$(KVER)-kirkwood.img uInit-ipfire-kirkwood
# omap kernel
/sbin/dracut --force --verbose --strip /boot/ipfirerd-$(KVER)-omap.img $(KVER)-ipfire-omap
cd /boot && mkimage -A arm -T ramdisk -C lzma -d ipfirerd-$(KVER)-omap.img uInit-ipfire-omap
# arm7 multi kernel
/sbin/dracut --force --verbose --strip /boot/ipfirerd-$(KVER)-multi.img $(KVER)-ipfire-multi
cd /boot && mkimage -A arm -T ramdisk -C lzma -d ipfirerd-$(KVER)-multi.img uInit-ipfire-multi
# cd /boot && cp -f ipfirerd-$(KVER)-multi.img zInit-ipfire-multi
else
/sbin/dracut --force --verbose --strip /boot/ipfirerd-$(KVER).img $(KVER)-ipfire
endif

View File

@@ -86,7 +86,7 @@ endif
# Install MLO and uboot first
ifeq "$(MACHINE_TYPE)" "arm"
cp -v /boot/MLO $(MNThdd)/boot/
cp -v /boot/u-boot.bin $(MNThdd)/boot/
cp -v /boot/u-boot.img $(MNThdd)/boot/
sync
umount $(MNThdd)/boot
mount -o loop $(IMGboot) $(MNThdd)/boot
@@ -182,7 +182,7 @@ ifneq "$(MACHINE_TYPE)" "arm"
sed -i -e "s| panic=10 | console=ttyS0,115200n8 panic=10 |g" $(MNThdd)/boot/grub/grub.conf
else
sed -i -e "s| console=tty1 | console=ttyAMA0,115200n8 |g" $(MNThdd)/boot/cmdline.txt
sed -i -e "s| console=tty1 omapfb.mode=dvi:800x600MR-16@60 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/boot.script
sed -i -e "s| console=tty1 | console=ttyO2,115200n8 |g" $(MNThdd)/boot/boot.script
cd $(MNThdd)/boot && ./convert_bootscript
endif

View File

@@ -157,18 +157,11 @@ ifeq "$(KCFG)" "-kirkwood"
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10.10-mv_cesa_disable_failing_hmac_sha1.patch
endif
ifeq "$(MACHINE_TYPE)" "arm"
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.6.32.45_align_ssb_modtable_32bit_boundary.patch
# Reverse some asm optimizations that are incompatible with older gcc
# cd $(DIR_APP) && patch -p1 -R < $(DIR_SRC)/src/patches/linux-2.6-arm-asm-constraint.patch
endif
ifeq "$(KCFG)" "-omap"
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0001-panda-wlan-fix.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0002-panda-i2c.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-panda-reboot.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-2.x-smsc95xx-add_mac_addr_param.patch
ifeq "$(KCFG)" "-multi"
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0001-panda-wlan-fix.patch
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-0002-panda-i2c.patch
# cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.2-panda-reboot.patch
cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/linux-3.10-smsc95xx-add_mac_addr_param.patch
endif
ifeq "$(KCFG)" "-rpi"
@@ -199,10 +192,10 @@ ifeq "$(KCFG)" "-kirkwood"
cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
else
ifeq "$(KCFG)" "-omap"
cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" uImage
cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && cp -v arch/arm/boot/uImage /boot/uImage-$(VERSUFIX)
ifeq "$(KCFG)" "-multi"
cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage
cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/vmlinuz-$(VER)-$(VERSUFIX)
cd $(DIR_APP) && cp -v arch/arm/boot/zImage /boot/zImage-$(VERSUFIX)
else
ifeq "$(KCFG)" "-rpi"
cd $(DIR_APP) && make $(MAKETUNING) CC="$(KGCC)" zImage
@@ -222,6 +215,14 @@ endif
cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) modules_install
cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) firmware_install
ifeq "$(MACHINE_TYPE)" "arm"
cd $(DIR_APP) && make CC="$(KGCC)" $(MAKETUNING) dtbs
cd $(DIR_APP) && for f in $$(find arch/arm/boot/dts/ -name *.dtb); do \
mkdir -p /boot/dtb-$(VER)-$(VERSUFIX) ; \
install -m 644 $$f /boot/dtb-$(VER)-$(VERSUFIX)/ ; \
done
endif
ifeq "$(LASTKERNEL)" "1"
# Only do this once
cd $(DIR_APP) && install -m 755 usr/gen_init_cpio /sbin/

View File

@@ -1,7 +1,7 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
# Copyright (C) 2007-2013 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
@@ -79,8 +79,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
-mkdir -pv /usr/share/u-boot/pandaboard
cd $(DIR_APP) && make CROSS_COMPILE="" omap4_panda_config
cd $(DIR_APP) && make CROSS_COMPILE="" HOSTCC="gcc $(CFLAGS)"
cd $(DIR_APP) && install -v -m 644 MLO u-boot.bin u-boot.img \
cd $(DIR_APP) && install -v -m 644 MLO u-boot.img \
/usr/share/u-boot/pandaboard
# Install pandaboard uboot as default
cd $(DIR_APP) && install MLO /boot/
cd $(DIR_APP) && install u-boot.img /boot/
cp -vf $(DIR_SRC)/config/u-boot/* /boot/
cd $(DIR_APP) && make distclean
# Wandboard Quad

View File

@@ -1,85 +0,0 @@
###############################################################################
# #
# IPFire.org - A linux based firewall #
# Copyright (C) 2007-2011 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation, either version 3 of the License, or #
# (at your option) any later version. #
# #
# 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, see <http://www.gnu.org/licenses/>. #
# #
###############################################################################
###############################################################################
# Definitions
###############################################################################
include Config
VER = 2011.12
# Linare version: git clone git://git.linaro.org/boot/u-boot-linaro-stable.git
# Branch: origin/Linaro-u-boot-2011.12
THISAPP = uboot-panda-$(VER)
DL_FILE = $(THISAPP).tar.xz
DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
SUP_ARCH = armv5tel
###############################################################################
# Top-level Rules
###############################################################################
objects = $(DL_FILE)
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
$(DL_FILE)_MD5 = 19975e9bb4b10d8e67db84e51fcaa43b
install : $(TARGET)
check : $(patsubst %,$(DIR_CHK)/%,$(objects))
download :$(patsubst %,$(DIR_DL)/%,$(objects))
md5 : $(subst %,%_MD5,$(objects))
###############################################################################
# Downloading, checking, md5sum
###############################################################################
$(patsubst %,$(DIR_CHK)/%,$(objects)) :
@$(CHECK)
$(patsubst %,$(DIR_DL)/%,$(objects)) :
@$(LOAD)
$(subst %,%_MD5,$(objects)) :
@$(MD5)
dist:
@$(PAK)
###############################################################################
# Installation Details
###############################################################################
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar Jxf $(DIR_DL)/$(DL_FILE)
cd $(DIR_APP) && make omap4_panda_config
cd $(DIR_APP) && make $(MAKETUNING)
cd $(DIR_APP) && install MLO /boot/
cd $(DIR_APP) && install u-boot.bin /boot/
cp -vf $(DIR_SRC)/config/u-boot/* /boot/
@rm -rf $(DIR_APP)
@$(POSTBUILD)

10
make.sh
View File

@@ -380,7 +380,6 @@ buildipfire() {
ipfiremake rpi-firmware
ipfiremake bc
ipfiremake u-boot
ipfiremake u-boot-panda
if [ "${MACHINE_TYPE}" != "arm" ]; then
@@ -431,12 +430,9 @@ buildipfire() {
ipfiremake cryptodev KCFG="-rpi"
# ipfiremake compat-drivers KCFG="-rpi"
# arm-omap (Panda Board) kernel build
# ipfiremake linux KCFG="-omap"
# ipfiremake v4l-dvb KCFG="-omap"
# ipfiremake mISDN KCFG="-omap" NOPCI=1
# ipfiremake cryptodev KCFG="-omap"
# ipfiremake compat-drivers KCFG="-omap"
# arm multi platform (Panda, Wandboard ...) kernel build
ipfiremake linux KCFG="-multi"
ipfiremake cryptodev KCFG="-multi"
# arm-kirkwood (Dreamplug, ICY-Box ...) kernel build
ipfiremake linux KCFG="-kirkwood"

View File

@@ -0,0 +1,82 @@
diff -Naur linux-3.10.10/drivers/net/usb/smsc95xx.c linux-c1af7c6db316763b9dce7137495cb9ada8fa17b4/drivers/net/usb/smsc95xx.c
--- linux-3.10.10/drivers/net/usb/smsc95xx.c 2013-08-29 18:47:51.000000000 +0200
+++ linux-c1af7c6db316763b9dce7137495cb9ada8fa17b4/drivers/net/usb/smsc95xx.c 2013-08-30 20:12:54.000000000 +0200
@@ -61,6 +61,7 @@
#define SUSPEND_SUSPEND3 (0x08)
#define SUSPEND_ALLMODES (SUSPEND_SUSPEND0 | SUSPEND_SUSPEND1 | \
SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3)
+#define MAC_ADDR_LEN (6)
struct smsc95xx_priv {
u32 mac_cr;
@@ -76,6 +77,10 @@
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
+static char *macaddr = ":";
+module_param(macaddr, charp, 0);
+MODULE_PARM_DESC(macaddr, "MAC address");
+
static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
u32 *data, int in_pm)
{
@@ -765,8 +770,59 @@
return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
}
+/* Check the macaddr module parameter for a MAC address */
+static int smsc95xx_is_macaddr_param(struct usbnet *dev, u8 *dev_mac)
+{
+ int i, j, got_num, num;
+ u8 mtbl[MAC_ADDR_LEN];
+
+ if (macaddr[0] == ':')
+ return 0;
+
+ i = 0;
+ j = 0;
+ num = 0;
+ got_num = 0;
+ while (j < MAC_ADDR_LEN) {
+ if (macaddr[i] && macaddr[i] != ':') {
+ got_num++;
+ if ('0' <= macaddr[i] && macaddr[i] <= '9')
+ num = num * 16 + macaddr[i] - '0';
+ else if ('A' <= macaddr[i] && macaddr[i] <= 'F')
+ num = num * 16 + 10 + macaddr[i] - 'A';
+ else if ('a' <= macaddr[i] && macaddr[i] <= 'f')
+ num = num * 16 + 10 + macaddr[i] - 'a';
+ else
+ break;
+ i++;
+ } else if (got_num == 2) {
+ mtbl[j++] = (u8) num;
+ num = 0;
+ got_num = 0;
+ i++;
+ } else {
+ break;
+ }
+ }
+
+ if (j == MAC_ADDR_LEN) {
+ netif_dbg(dev, ifup, dev->net, "Overriding MAC address with: "
+ "%02x:%02x:%02x:%02x:%02x:%02x\n", mtbl[0], mtbl[1], mtbl[2],
+ mtbl[3], mtbl[4], mtbl[5]);
+ for (i = 0; i < MAC_ADDR_LEN; i++)
+ dev_mac[i] = mtbl[i];
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
static void smsc95xx_init_mac_address(struct usbnet *dev)
{
+ /* Check module parameters */
+ if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr))
+ return;
+
/* try reading mac address from EEPROM */
if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
dev->net->dev_addr) == 0) {