U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
August 2008
- 172 participants
- 523 discussions

[U-Boot] [PATCH] mpc86xx: use r4 instead of r2 in lock_ram_in_cache and unlock_ram_in_cache
by Nick Spence 13 Oct '08
by Nick Spence 13 Oct '08
13 Oct '08
This is needed in unlock_ram_in_cache() because it is called from C and
will corrupt the small data area anchor that is kept in R2.
lock_ram_in_cache() is modified similarly as good coding practice, but
is not called from C.
Signed-off-by: Nick Spence <nick.spence(a)freescale.com>
---
cpu/mpc86xx/start.S | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/cpu/mpc86xx/start.S b/cpu/mpc86xx/start.S
index 03f2128..90a1b83 100644
--- a/cpu/mpc86xx/start.S
+++ b/cpu/mpc86xx/start.S
@@ -895,9 +895,9 @@ lock_ram_in_cache:
*/
lis r3, (CFG_INIT_RAM_ADDR & ~31)@h
ori r3, r3, (CFG_INIT_RAM_ADDR & ~31)@l
- li r2, ((CFG_INIT_RAM_END & ~31) + \
+ li r4, ((CFG_INIT_RAM_END & ~31) + \
(CFG_INIT_RAM_ADDR & 31) + 31) / 32
- mtctr r2
+ mtctr r4
1:
dcbz r0, r3
addi r3, r3, 32
@@ -930,9 +930,9 @@ unlock_ram_in_cache:
/* invalidate the INIT_RAM section */
lis r3, (CFG_INIT_RAM_ADDR & ~31)@h
ori r3, r3, (CFG_INIT_RAM_ADDR & ~31)@l
- li r2, ((CFG_INIT_RAM_END & ~31) + \
+ li r4, ((CFG_INIT_RAM_END & ~31) + \
(CFG_INIT_RAM_ADDR & 31) + 31) / 32
- mtctr r2
+ mtctr r4
1: icbi r0, r3
addi r3, r3, 32
bdnz 1b
--
1.5.2.2
2
2

13 Oct '08
For some reason we duplicated the majority of code in lib_ppc/interrupts.c
not show how that happened, but there is no good reason for it.
Use the interrupt_init_cpu() and timer_interrupt_cpu() since its why
they exist.
Signed-off-by: Kumar Gala <galak(a)kernel.crashing.org>
---
cpu/mpc86xx/interrupts.c | 131 +++-------------------------------------------
1 files changed, 7 insertions(+), 124 deletions(-)
diff --git a/cpu/mpc86xx/interrupts.c b/cpu/mpc86xx/interrupts.c
index f16744b..fa2cfac 100644
--- a/cpu/mpc86xx/interrupts.c
+++ b/cpu/mpc86xx/interrupts.c
@@ -35,78 +35,23 @@
#include <mpc86xx.h>
#include <command.h>
#include <asm/processor.h>
-#include <ppc_asm.tmpl>
-#include <watchdog.h>
-unsigned long decrementer_count; /* count value for 1e6/HZ microseconds */
-unsigned long timestamp;
-
-
-static __inline__ unsigned long get_msr(void)
-{
- unsigned long msr;
-
- asm volatile ("mfmsr %0":"=r" (msr):);
-
- return msr;
-}
-
-static __inline__ void set_msr(unsigned long msr)
-{
- asm volatile ("mtmsr %0"::"r" (msr));
-}
-
-static __inline__ unsigned long get_dec(void)
-{
- unsigned long val;
-
- asm volatile ("mfdec %0":"=r" (val):);
-
- return val;
-}
-
-static __inline__ void set_dec(unsigned long val)
-{
- if (val)
- asm volatile ("mtdec %0"::"r" (val));
-}
-
-/* interrupt is not supported yet */
int interrupt_init_cpu(unsigned long *decrementer_count)
{
- return 0;
-}
-
-int interrupt_init(void)
-{
- int ret;
-
volatile immap_t *immr = (immap_t *)CFG_IMMR;
- immr->im_pic.gcr = MPC86xx_PICGCR_RST;
- while (immr->im_pic.gcr & MPC86xx_PICGCR_RST);
- immr->im_pic.gcr = MPC86xx_PICGCR_MODE;
-
- /* call cpu specific function from $(CPU)/interrupts.c */
- ret = interrupt_init_cpu(&decrementer_count);
+ volatile ccsr_pic_t *pic = &immr->im_pic;
- if (ret)
- return ret;
+ pic->gcr = MPC86xx_PICGCR_RST;
+ while (pic->gcr & MPC86xx_PICGCR_RST)
+ ;
+ pic->gcr = MPC86xx_PICGCR_MODE;
- decrementer_count = get_tbclk() / CFG_HZ;
+ *decrementer_count = get_tbclk() / CFG_HZ;
debug("interrupt init: tbclk() = %d MHz, decrementer_count = %ld\n",
(get_tbclk() / 1000000),
- decrementer_count);
-
- set_dec(decrementer_count);
-
- set_msr(get_msr() | MSR_EE);
-
- debug("MSR = 0x%08lx, Decrementer reg = 0x%08lx\n",
- get_msr(),
- get_dec());
+ *decrementer_count);
#ifdef CONFIG_INTERRUPTS
- volatile ccsr_pic_t *pic = &immr->im_pic;
pic->iivpr1 = 0x810001; /* 50220 enable mcm interrupts */
debug("iivpr1@%x = %x\n", &pic->iivpr1, pic->iivpr1);
@@ -132,25 +77,6 @@ int interrupt_init(void)
return 0;
}
-void enable_interrupts(void)
-{
- set_msr(get_msr() | MSR_EE);
-}
-
-/* returns flag if MSR_EE was set before */
-int disable_interrupts(void)
-{
- ulong msr = get_msr();
-
- set_msr(msr & ~MSR_EE);
- return (msr & MSR_EE) != 0;
-}
-
-void increment_timestamp(void)
-{
- timestamp++;
-}
-
/*
* timer_interrupt - gets called when the decrementer overflows,
* with interrupts disabled.
@@ -161,50 +87,9 @@ void timer_interrupt_cpu(struct pt_regs *regs)
/* nothing to do here */
}
-void timer_interrupt(struct pt_regs *regs)
-{
- /* call cpu specific function from $(CPU)/interrupts.c */
- timer_interrupt_cpu(regs);
-
- timestamp++;
-
- /* Restore Decrementer Count */
- set_dec(decrementer_count);
-
-#if defined(CONFIG_WATCHDOG) || defined (CONFIG_HW_WATCHDOG)
- if ((timestamp % (CFG_WATCHDOG_FREQ)) == 0)
- WATCHDOG_RESET();
-#endif /* CONFIG_WATCHDOG || CONFIG_HW_WATCHDOG */
-
-#ifdef CONFIG_STATUS_LED
- status_led_tick(timestamp);
-#endif /* CONFIG_STATUS_LED */
-
-#ifdef CONFIG_SHOW_ACTIVITY
- board_show_activity(timestamp);
-#endif /* CONFIG_SHOW_ACTIVITY */
-
-}
-
-void reset_timer(void)
-{
- timestamp = 0;
-}
-
-ulong get_timer(ulong base)
-{
- return timestamp - base;
-}
-
-void set_timer(ulong t)
-{
- timestamp = t;
-}
-
/*
* Install and free a interrupt handler. Not implemented yet.
*/
-
void irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
{
}
@@ -218,8 +103,6 @@ void irq_free_handler(int vec)
*/
int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- printf("\nInterrupt-unsupported:\n");
-
return 0;
}
--
1.5.5.1
2
3

[U-Boot] PATCH: U-Boot support for Olimex SAM9L-9260 development board
by Markus Kammerstetter 13 Oct '08
by Markus Kammerstetter 13 Oct '08
13 Oct '08
Hi,
I added support for the Olimex SAM9L-9260 development board to the
current git source tree.
The original code is from the at91sam9260ek implementation and has been modified
to work with the Olimex board.
I also changed cpu/arm926ejs/at91/ether.c to be able to specify a custom PHY address
with CONFIG_EMAC_PHY_ADDR instead of having the fixed address "0x00" in the code.
Signed-off-by: Markus Kammerstetter <m.kammerstetter <at> tbmn.org>
---
diff -uprN git-orig/board/sam9l9260/config.mk git-olimex/board/sam9l9260/config.mk
--- git-orig/board/sam9l9260/config.mk 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/board/sam9l9260/config.mk 2008-08-27 21:43:31.000000000 +0200
@@ -0,0 +1 @@
+TEXT_BASE = 0x23f00000
diff -uprN git-orig/board/sam9l9260/led.c git-olimex/board/sam9l9260/led.c
--- git-orig/board/sam9l9260/led.c 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/board/sam9l9260/led.c 2008-08-27 21:43:31.000000000 +0200
@@ -0,0 +1,64 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop(a)leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
+
+#define RED_LED AT91_PIN_PA9 /* this is the power led */
+#define GREEN_LED AT91_PIN_PA6 /* this is the user led */
+
+void red_LED_on(void)
+{
+ at91_set_gpio_value(RED_LED, 1);
+}
+
+void red_LED_off(void)
+{
+ at91_set_gpio_value(RED_LED, 0);
+}
+
+void green_LED_on(void)
+{
+ at91_set_gpio_value(GREEN_LED, 0);
+}
+
+void green_LED_off(void)
+{
+ at91_set_gpio_value(GREEN_LED, 1);
+}
+
+void coloured_LED_init(void)
+{
+ /* Enable clock */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOA);
+
+ at91_set_gpio_output(RED_LED, 1);
+ at91_set_gpio_output(GREEN_LED, 1);
+
+ at91_set_gpio_value(RED_LED, 0);
+ at91_set_gpio_value(GREEN_LED, 1);
+}
diff -uprN git-orig/board/sam9l9260/Makefile git-olimex/board/sam9l9260/Makefile
--- git-orig/board/sam9l9260/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/board/sam9l9260/Makefile 2008-08-27 21:43:31.000000000 +0200
@@ -0,0 +1,60 @@
+#
+# (C) Copyright 2003-2008
+# Wolfgang Denk, DENX Software Engineering, wd(a)denx.de.
+#
+# (C) Copyright 2008
+# Stelian Pop <stelian.pop(a)leadtechdesign.com>
+# Lead Tech Design <www.leadtechdesign.com>
+#
+# Modified to work with the Olimex SAM9L9260 board by:
+# Markus Kammerstetter <m.kammerstetter (at) tbmn.org>
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(BOARD).a
+
+COBJS-y += sam9l9260.o
+COBJS-y += led.o
+COBJS-y += partition.o
+COBJS-$(CONFIG_CMD_NAND) += nand.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS-y))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS) $(SOBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff -uprN git-orig/board/sam9l9260/nand.c git-olimex/board/sam9l9260/nand.c
--- git-orig/board/sam9l9260/nand.c 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/board/sam9l9260/nand.c 2008-08-27 21:43:31.000000000 +0200
@@ -0,0 +1,78 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop(a)leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * (C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/at91_pio.h>
+
+#include <nand.h>
+
+/*
+ * hardware specific access to control-lines
+ */
+#define MASK_ALE (1 << 21) /* our ALE is AD21 */
+#define MASK_CLE (1 << 22) /* our CLE is AD22 */
+
+static void at91sam9260ek_nand_hwcontrol(struct mtd_info *mtd,
+ int cmd, unsigned int ctrl)
+{
+ struct nand_chip *this = mtd->priv;
+
+ if (ctrl & NAND_CTRL_CHANGE) {
+ ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
+ IO_ADDR_W &= ~(MASK_ALE | MASK_CLE);
+
+ if (ctrl & NAND_CLE)
+ IO_ADDR_W |= MASK_CLE;
+ if (ctrl & NAND_ALE)
+ IO_ADDR_W |= MASK_ALE;
+
+ at91_set_gpio_value(AT91_PIN_PC14, !(ctrl & NAND_NCE));
+ this->IO_ADDR_W = (void *) IO_ADDR_W;
+ }
+
+ if (cmd != NAND_CMD_NONE)
+ writeb(cmd, this->IO_ADDR_W);
+}
+
+static int at91sam9260ek_nand_ready(struct mtd_info *mtd)
+{
+ return at91_get_gpio_value(AT91_PIN_PC13);
+}
+
+int board_nand_init(struct nand_chip *nand)
+{
+ nand->ecc.mode = NAND_ECC_SOFT;
+#ifdef CFG_NAND_DBW_16
+ nand->options = NAND_BUSWIDTH_16;
+#endif
+ nand->cmd_ctrl = at91sam9260ek_nand_hwcontrol;
+ nand->dev_ready = at91sam9260ek_nand_ready;
+ nand->chip_delay = 20;
+
+ return 0;
+}
diff -uprN git-orig/board/sam9l9260/partition.c git-olimex/board/sam9l9260/partition.c
--- git-orig/board/sam9l9260/partition.c 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/board/sam9l9260/partition.c 2008-08-27 21:43:31.000000000 +0200
@@ -0,0 +1,40 @@
+/*
+ * (C) Copyright 2008
+ * Ulf Samuelsson <ulf(a)atmel.com>
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+#include <common.h>
+#include <config.h>
+#include <asm/hardware.h>
+#include <dataflash.h>
+
+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
+
+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
+ {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */
+ {CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
+};
+
+/*define the area offsets*/
+dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
+ {0x00000000, 0x000041FF, FLAG_PROTECT_SET, 0, "Bootstrap"},
+ {0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
+ {0x00008400, 0x00041FFF, FLAG_PROTECT_SET, 0, "U-Boot"},
+ {0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0, "Kernel"},
+ {0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0, "FS"},
+};
diff -uprN git-orig/board/sam9l9260/sam9l9260.c git-olimex/board/sam9l9260/sam9l9260.c
--- git-orig/board/sam9l9260/sam9l9260.c 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/board/sam9l9260/sam9l9260.c 2008-08-27 21:43:31.000000000 +0200
@@ -0,0 +1,260 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop(a)leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * Modified to work with the Olimex SAM9L9260 board by:
+ * Markus Kammerstetter <m.kammerstetter (at) tbmn.org>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <asm/arch/at91sam9260.h>
+#include <asm/arch/at91sam9260_matrix.h>
+#include <asm/arch/at91sam9_smc.h>
+#include <asm/arch/at91_pmc.h>
+#include <asm/arch/at91_rstc.h>
+#include <asm/arch/gpio.h>
+#include <asm/arch/io.h>
+#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
+#include <net.h>
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* ------------------------------------------------------------------------- */
+/*
+ * Miscelaneous platform dependent initialisations
+ */
+
+static void at91sam9260ek_serial_hw_init(void)
+{
+#ifdef CONFIG_USART0
+ at91_set_A_periph(AT91_PIN_PB4, 1); /* TXD0 */
+ at91_set_A_periph(AT91_PIN_PB5, 0); /* RXD0 */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US0);
+#endif
+
+#ifdef CONFIG_USART1
+ at91_set_A_periph(AT91_PIN_PB6, 1); /* TXD1 */
+ at91_set_A_periph(AT91_PIN_PB7, 0); /* RXD1 */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US1);
+#endif
+
+#ifdef CONFIG_USART2
+ at91_set_A_periph(AT91_PIN_PB8, 1); /* TXD2 */
+ at91_set_A_periph(AT91_PIN_PB9, 0); /* RXD2 */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US2);
+#endif
+
+#ifdef CONFIG_USART3 /* DBGU */
+ at91_set_A_periph(AT91_PIN_PB14, 0); /* DRXD */
+ at91_set_A_periph(AT91_PIN_PB15, 1); /* DTXD */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
+#endif
+}
+
+#ifdef CONFIG_CMD_NAND
+static void at91sam9260ek_nand_hw_init(void)
+{
+ unsigned long csa;
+
+ /* Enable CS3 */
+ csa = at91_sys_read(AT91_MATRIX_EBICSA);
+ at91_sys_write(AT91_MATRIX_EBICSA,
+ csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
+
+ /* Configure SMC CS3 for NAND/SmartMedia */
+ at91_sys_write(AT91_SMC_SETUP(3),
+ AT91_SMC_NWESETUP_(1) | AT91_SMC_NCS_WRSETUP_(0) |
+ AT91_SMC_NRDSETUP_(1) | AT91_SMC_NCS_RDSETUP_(0));
+ at91_sys_write(AT91_SMC_PULSE(3),
+ AT91_SMC_NWEPULSE_(3) | AT91_SMC_NCS_WRPULSE_(3) |
+ AT91_SMC_NRDPULSE_(3) | AT91_SMC_NCS_RDPULSE_(3));
+ at91_sys_write(AT91_SMC_CYCLE(3),
+ AT91_SMC_NWECYCLE_(5) | AT91_SMC_NRDCYCLE_(5));
+ at91_sys_write(AT91_SMC_MODE(3),
+ AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
+ AT91_SMC_EXNWMODE_DISABLE |
+#ifdef CFG_NAND_DBW_16
+ AT91_SMC_DBW_16 |
+#else /* CFG_NAND_DBW_8 */
+ AT91_SMC_DBW_8 |
+#endif
+ AT91_SMC_TDF_(2));
+
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOC);
+
+ /* Configure RDY/BSY */
+ at91_set_gpio_input(AT91_PIN_PC13, 1);
+
+ /* Enable NandFlash */
+ at91_set_gpio_output(AT91_PIN_PC14, 1);
+}
+#endif
+
+#ifdef CONFIG_HAS_DATAFLASH
+static void at91sam9260ek_spi_hw_init(void)
+{
+ at91_set_A_periph(AT91_PIN_PA3, 0); /* SPI0_NPCS0 */
+ at91_set_B_periph(AT91_PIN_PC11, 0); /* SPI0_NPCS1 */
+
+ at91_set_A_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
+ at91_set_A_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
+ at91_set_A_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
+
+ /* Enable clock */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_SPI0);
+}
+#endif
+
+#ifdef CONFIG_MACB
+static void at91sam9260ek_macb_hw_init(void)
+{
+ /* Enable clock */
+ at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_EMAC);
+
+ /*
+ * Disable pull-up on:
+ * RXDV (PA17) => PHY normal mode (not Test mode)
+ * ERX0 (PA14) => PHY ADDR0
+ * ERX1 (PA15) => PHY ADDR1
+ * ERX2 (PA25) => PHY ADDR2
+ * ERX3 (PA26) => PHY ADDR3
+ * ECRS (PA28) => PHY ADDR4 => PHYADDR = 0x0
+ *
+ * However, micrel PHY has internal pull-up for PHY ADDR1, thus PHY addr = 1
+ */
+ writel(pin_to_mask(AT91_PIN_PA14) |
+ pin_to_mask(AT91_PIN_PA15) |
+ pin_to_mask(AT91_PIN_PA17) |
+ pin_to_mask(AT91_PIN_PA18) | // disable ISOLATE strapping option
+ pin_to_mask(AT91_PIN_PA25) |
+ pin_to_mask(AT91_PIN_PA26) |
+ pin_to_mask(AT91_PIN_PA28),
+ pin_to_controller(AT91_PIN_PA0) + PIO_PUDR);
+
+ /* Need to reset PHY -> 500ms reset */
+ at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
+ (AT91_RSTC_ERSTL & (0x0D << 8)) |
+ AT91_RSTC_URSTEN);
+
+ /* trigger external reset */
+ at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
+
+ /* Wait for end hardware reset */
+ while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL));
+
+ /* Restore NRST value */
+ at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
+ (AT91_RSTC_ERSTL & (0x0 << 8)) |
+ AT91_RSTC_URSTEN);
+
+ /* Re-enable pull-up */
+ writel(pin_to_mask(AT91_PIN_PA14) |
+ pin_to_mask(AT91_PIN_PA15) |
+ pin_to_mask(AT91_PIN_PA17) |
+ pin_to_mask(AT91_PIN_PA18) |
+ pin_to_mask(AT91_PIN_PA25) |
+ pin_to_mask(AT91_PIN_PA26) |
+ pin_to_mask(AT91_PIN_PA28),
+ pin_to_controller(AT91_PIN_PA0) + PIO_PUER);
+
+ /*
+ * At this state the PHY should know it's address (PHYADDR = 0x0)
+ * After reset completion the pull-ups have been enabled so that we can use the
+ * ERX pins
+ */
+
+ at91_set_A_periph(AT91_PIN_PA19, 0); /* ETXCK_EREFCK */
+ at91_set_A_periph(AT91_PIN_PA17, 0); /* ERXDV */
+ at91_set_A_periph(AT91_PIN_PA14, 0); /* ERX0 */
+ at91_set_A_periph(AT91_PIN_PA15, 0); /* ERX1 */
+ at91_set_A_periph(AT91_PIN_PA18, 0); /* ERXER */
+ at91_set_A_periph(AT91_PIN_PA16, 0); /* ETXEN */
+ at91_set_A_periph(AT91_PIN_PA12, 0); /* ETX0 */
+ at91_set_A_periph(AT91_PIN_PA13, 0); /* ETX1 */
+ at91_set_A_periph(AT91_PIN_PA21, 0); /* EMDIO */
+ at91_set_A_periph(AT91_PIN_PA20, 0); /* EMDC */
+
+#ifndef CONFIG_RMII
+ at91_set_B_periph(AT91_PIN_PA28, 0); /* ECRS */
+ at91_set_B_periph(AT91_PIN_PA29, 0); /* ECOL */
+ at91_set_B_periph(AT91_PIN_PA25, 0); /* ERX2 */
+ at91_set_B_periph(AT91_PIN_PA26, 0); /* ERX3 */
+ at91_set_B_periph(AT91_PIN_PA27, 0); /* ERXCK */
+
+ /*
+ * use PA10, PA11 for ETX2, ETX3.
+ * PA23 and PA24 are for TWI EEPROM
+ */
+ at91_set_B_periph(AT91_PIN_PA10, 0); /* ETX2 */
+ at91_set_B_periph(AT91_PIN_PA11, 0); /* ETX3 */
+ at91_set_B_periph(AT91_PIN_PA22, 0); /* ETXER */
+#endif
+
+}
+#endif
+
+int board_init(void)
+{
+ /* Enable Ctrlc */
+ console_init_f();
+
+ /* arch number of olimex sam9l9260 board */
+ gd->bd->bi_arch_number = MACH_TYPE_SAM9_L9260;
+ /* adress of boot parameters */
+ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
+
+ /* system controller clock should be enabled already */
+
+ at91sam9260ek_serial_hw_init();
+#ifdef CONFIG_CMD_NAND
+ at91sam9260ek_nand_hw_init();
+#endif
+#ifdef CONFIG_HAS_DATAFLASH
+ at91sam9260ek_spi_hw_init();
+#endif
+#ifdef CONFIG_MACB
+ at91sam9260ek_macb_hw_init();
+#endif
+
+ return 0;
+}
+
+int dram_init(void)
+{
+ gd->bd->bi_dram[0].start = PHYS_SDRAM;
+ gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
+ return 0;
+}
+
+#ifdef CONFIG_RESET_PHY_R
+void reset_phy(void)
+{
+#ifdef CONFIG_MACB
+ /*
+ * Initialize ethernet HW addr prior to starting Linux,
+ * needed for nfsroot
+ */
+ eth_init(gd->bd);
+#endif
+}
+#endif
diff -uprN git-orig/cpu/arm926ejs/at91/ether.c git-olimex/cpu/arm926ejs/at91/ether.c
--- git-orig/cpu/arm926ejs/at91/ether.c 2008-08-27 17:43:21.000000000 +0200
+++ git-olimex/cpu/arm926ejs/at91/ether.c 2008-08-27 22:08:20.000000000 +0200
@@ -30,6 +30,10 @@ extern int macb_eth_initialize(int id, v
#if defined(CONFIG_MACB) && defined(CONFIG_CMD_NET)
void at91sam9_eth_initialize(bd_t *bi)
{
+#if defined(CONFIG_EMAC_PHY_ADDR)
+ macb_eth_initialize(0, (void *)AT91_BASE_EMAC, CONFIG_EMAC_PHY_ADDR);
+#else
macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
+#endif
}
#endif
Binary files git-orig/.git/index and git-olimex/.git/index differ
diff -uprN git-orig/include/configs/sam9l9260.h git-olimex/include/configs/sam9l9260.h
--- git-orig/include/configs/sam9l9260.h 1970-01-01 01:00:00.000000000 +0100
+++ git-olimex/include/configs/sam9l9260.h 2008-08-27 21:49:38.000000000 +0200
@@ -0,0 +1,211 @@
+/*
+ * (C) Copyright 2007-2008
+ * Stelian Pop <stelian.pop(a)leadtechdesign.com>
+ * Lead Tech Design <www.leadtechdesign.com>
+ *
+ * Modified to work with the Olimex SAM9L9260 board by:
+ * Markus Kammerstetter <m.kammerstetter (at) tbmn.org>
+ *
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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 2 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/* ARM asynchronous clock */
+#define AT91_MAIN_CLOCK 180224000
+#define AT91_MASTER_CLOCK (180224000/2)
+#define CFG_HZ 1000000 /* 1us resolution */
+
+#define AT91_SLOW_CLOCK 32768 /* slow clock */
+
+#define CONFIG_ARM926EJS 1 /* This is an ARM926EJS Core */
+#define CONFIG_AT91SAM9260 1 /* It's an Atmel AT91SAM9260 SoC*/
+#define CONFIG_SAM9_L9260 1 /* olimex sam 9l9260 board */
+#undef CONFIG_USE_IRQ /* we don't need IRQ/FIQ stuff */
+
+#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
+#define CONFIG_SETUP_MEMORY_TAGS 1
+#define CONFIG_INITRD_TAG 1
+
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SKIP_RELOCATE_UBOOT
+
+/*
+ * Hardware drivers
+ */
+#define CONFIG_ATMEL_USART 1
+#undef CONFIG_USART0
+#undef CONFIG_USART1
+#undef CONFIG_USART2
+#define CONFIG_USART3 1 /* USART 3 is DBGU */
+
+#define CONFIG_BOOTDELAY 3
+
+/*
+ * BOOTP options
+ */
+#define CONFIG_BOOTP_BOOTFILESIZE 1
+#define CONFIG_BOOTP_BOOTPATH 1
+#define CONFIG_BOOTP_GATEWAY 1
+#define CONFIG_BOOTP_HOSTNAME 1
+
+/*
+ * Command line configuration.
+ */
+#include <config_cmd_default.h>
+#undef CONFIG_CMD_BDI
+#undef CONFIG_CMD_IMI
+#undef CONFIG_CMD_AUTOSCRIPT
+#undef CONFIG_CMD_FPGA
+#undef CONFIG_CMD_LOADS
+#undef CONFIG_CMD_IMLS
+
+#define CONFIG_CMD_PING 1
+#define CONFIG_CMD_DHCP 1
+#define CONFIG_CMD_NAND 1
+#define CONFIG_CMD_USB 1
+
+/* SDRAM */
+#define CONFIG_NR_DRAM_BANKS 1
+#define PHYS_SDRAM 0x20000000
+#define PHYS_SDRAM_SIZE 0x04000000 /* 64 megs */
+
+/* DataFlash */
+#define CONFIG_HAS_DATAFLASH 1
+#define CFG_SPI_WRITE_TOUT (5*CFG_HZ)
+#define CFG_MAX_DATAFLASH_BANKS 2
+#define CFG_DATAFLASH_LOGIC_ADDR_CS0 0xC0000000 /* CS0 */
+#define CFG_DATAFLASH_LOGIC_ADDR_CS1 0xD0000000 /* CS1 */
+#define AT91_SPI_CLK 15000000
+#define DATAFLASH_TCSS (0x1a << 16)
+#define DATAFLASH_TCHS (0x1 << 24)
+
+/* NAND flash */
+#define NAND_MAX_CHIPS 1
+#define CFG_MAX_NAND_DEVICE 1
+#define CFG_NAND_BASE 0x40000000
+#define CFG_NAND_DBW_8 1
+
+/* NOR flash - no real flash on this board */
+#define CFG_NO_FLASH 1
+
+/* Ethernet */
+#define CONFIG_MACB 1
+#undef CONFIG_RMII
+#define CONFIG_NET_MULTI 1
+#define CONFIG_NET_RETRY_COUNT 20
+#define CONFIG_RESET_PHY_R 1
+#define CONFIG_EMAC_PHY_ADDR 0x01
+
+/* USB */
+#define CONFIG_USB_OHCI_NEW 1
+#define LITTLEENDIAN 1
+#define CONFIG_DOS_PARTITION 1
+#define CFG_USB_OHCI_CPU_INIT 1
+#define CFG_USB_OHCI_REGS_BASE 0x00500000 /* AT91SAM9260_UHP_BASE */
+#define CFG_USB_OHCI_SLOT_NAME "at91sam9260"
+#define CFG_USB_OHCI_MAX_ROOT_PORTS 2
+#define CONFIG_USB_STORAGE 1
+
+#define CFG_LOAD_ADDR 0x22000000 /* load address */
+
+#define CFG_MEMTEST_START PHYS_SDRAM
+#define CFG_MEMTEST_END 0x23e00000
+
+/*
+#undef CFG_USE_DATAFLASH_CS0
+#define CFG_USE_DATAFLASH_CS1 1
+#undef CFG_USE_NANDFLASH
+*/
+
+#undef CFG_USE_DATAFLASH_CS0
+#undef CFG_USE_DATAFLASH_CS1
+#define CFG_USE_NANDFLASH 1
+
+#ifdef CFG_USE_DATAFLASH_CS0
+
+/* bootstrap + u-boot + env + linux in dataflash on CS0 */
+#define CFG_ENV_IS_IN_DATAFLASH 1
+#define CFG_MONITOR_BASE (CFG_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
+#define CFG_ENV_OFFSET 0x4200
+#define CFG_ENV_ADDR (CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
+#define CFG_ENV_SIZE 0x4200
+#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x22000000 0x210000; bootm"
+#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
+ "root=/dev/mtdblock0 " \
+ "mtdparts=at91_nand:-(root) " \
+ "rw rootfstype=jffs2"
+
+#elif CFG_USE_DATAFLASH_CS1
+
+/* bootstrap + u-boot + env + linux in dataflash on CS1 */
+#define CFG_ENV_IS_IN_DATAFLASH 1
+#define CFG_MONITOR_BASE (CFG_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
+#define CFG_ENV_OFFSET 0x4200
+#define CFG_ENV_ADDR (CFG_DATAFLASH_LOGIC_ADDR_CS1 + CFG_ENV_OFFSET)
+#define CFG_ENV_SIZE 0x4200
+#define CONFIG_BOOTCOMMAND "cp.b 0xD0042000 0x22000000 0x210000; bootm"
+#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
+ "root=/dev/mtdblock0 " \
+ "mtdparts=at91_nand:-(root) " \
+ "rw rootfstype=jffs2"
+
+#else /* CFG_USE_NANDFLASH */
+
+/* bootstrap + u-boot + env + linux in nandflash */
+#define CFG_ENV_IS_IN_NAND 1
+#define CFG_ENV_OFFSET 0x60000
+#define CFG_ENV_OFFSET_REDUND 0x80000
+#define CFG_ENV_SIZE 0x20000 /* 1 sector = 128 kB */
+#define CONFIG_BOOTCOMMAND "nand read 0x21500000 0x100000 0x200000; bootm"
+#define CONFIG_BOOTARGS "console=ttyS0,115200 " \
+ "root=/dev/mtdblock5 " \
+ "mtdparts=at91_nand:128k(bootstrap)ro," \
+ "256k(uboot)ro,128k(env1)ro," \
+ "128k(env2)ro,2M(linux),-(root) " \
+ "rw rootfstype=jffs2"
+
+#endif
+
+#define CONFIG_BAUDRATE 115200
+#define CFG_BAUDRATE_TABLE {115200 , 19200, 38400, 57600, 9600 }
+
+#define CFG_PROMPT "U-Boot> "
+#define CFG_CBSIZE 256
+#define CFG_MAXARGS 16
+#define CFG_PBSIZE (CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
+#define CFG_LONGHELP 1
+#define CONFIG_CMDLINE_EDITING 1
+
+#define ROUND(A, B) (((A) + (B)) & ~((B) - 1))
+/*
+ * Size of malloc() pool
+ */
+#define CFG_MALLOC_LEN ROUND(3 * CFG_ENV_SIZE + 128*1024, 0x1000)
+#define CFG_GBL_DATA_SIZE 128 /* 128 bytes for initial data */
+
+#define CONFIG_STACKSIZE (32*1024) /* regular stack */
+
+#ifdef CONFIG_USE_IRQ
+#error CONFIG_USE_IRQ not supported
+#endif
+
+#endif
diff -uprN git-orig/Makefile git-olimex/Makefile
--- git-orig/Makefile 2008-08-27 17:43:19.000000000 +0200
+++ git-olimex/Makefile 2008-08-27 21:43:55.000000000 +0200
@@ -2459,6 +2459,9 @@ at91cap9adk_config : unconfig
at91sam9260ek_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs at91sam9260ek atmel at91
+sam9l9260_config: unconfig
+ @$(MKCONFIG) $(@:_config=) arm arm926ejs sam9l9260 NULL at91
+
########################################################################
## ARM Integrator boards - see doc/README-integrator for more info.
integratorap_config \
---
3
2

13 Oct '08
get_prom function was used __attriute__ , but it is not enable.
ax88796.o does not do link besides ne2000.o. When ld is carried
out, get_prom function of ax88796.c is ignored.
This problem is a thing by specifications of ld.
I checked and test this patch on SuperH and MIPS.
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro(a)renesas.com>
---
drivers/net/Makefile | 6 +-
drivers/net/ax88796.c | 2 +-
drivers/net/ne2000.c | 719 +--------------------------------------------
drivers/net/ne2000_base.h | 36 ++-
4 files changed, 40 insertions(+), 723 deletions(-)
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index bcf31cb..734e058 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -42,10 +42,8 @@ COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
COBJS-$(CONFIG_MACB) += macb.o
COBJS-$(CONFIG_MCFFEC) += mcffec.o
COBJS-$(CONFIG_NATSEMI) += natsemi.o
-ifeq ($(CONFIG_DRIVER_NE2000),y)
-COBJS-y += ne2000.o
-COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o
-endif
+COBJS-$(CONFIG_DRIVER_NE2000) += ne2000.o ne2000_base.o
+COBJS-$(CONFIG_DRIVER_AX88796L) += ax88796.o ne2000_base.o
COBJS-$(CONFIG_DRIVER_NETARMETH) += netarm_eth.o
COBJS-$(CONFIG_NETCONSOLE) += netconsole.o
COBJS-$(CONFIG_DRIVER_NS7520_ETHERNET) += ns7520_eth.o
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 39cd101..2089141 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -143,7 +143,7 @@ static void ax88796_mac_read(u8 *buff)
}
}
-int get_prom(u8* mac_addr)
+int get_prom(u8* mac_addr, u8* base_addr)
{
u8 prom[32];
int i;
diff --git a/drivers/net/ne2000.c b/drivers/net/ne2000.c
index ec92485..ab5eec7 100644
--- a/drivers/net/ne2000.c
+++ b/drivers/net/ne2000.c
@@ -74,600 +74,11 @@ Add SNMP
#include <common.h>
#include <command.h>
-#include <net.h>
-#include <malloc.h>
-
-#define mdelay(n) udelay((n)*1000)
-/* forward definition of function used for the uboot interface */
-void uboot_push_packet_len(int len);
-void uboot_push_tx_done(int key, int val);
-
-/*
- * Debugging details
- *
- * Set to perms of:
- * 0 disables all debug output
- * 1 for process debug output
- * 2 for added data IO output: get_reg, put_reg
- * 4 for packet allocation/free output
- * 8 for only startup status, so we can tell we're installed OK
- */
-#if 0
-#define DEBUG 0xf
-#else
-#define DEBUG 0
-#endif
-
-#if DEBUG & 1
-#define DEBUG_FUNCTION() do { printf("%s\n", __FUNCTION__); } while (0)
-#define DEBUG_LINE() do { printf("%d\n", __LINE__); } while (0)
-#define PRINTK(args...) printf(args)
-#else
-#define DEBUG_FUNCTION() do {} while(0)
-#define DEBUG_LINE() do {} while(0)
-#define PRINTK(args...)
-#endif
/* NE2000 base header file */
#include "ne2000_base.h"
-#if defined(CONFIG_DRIVER_AX88796L)
-/* AX88796L support */
-#include "ax88796.h"
-#else
-/* Basic NE2000 chip support */
-#include "ne2000.h"
-#endif
-
-static dp83902a_priv_data_t nic; /* just one instance of the card supported */
-
-static bool
-dp83902a_init(void)
-{
- dp83902a_priv_data_t *dp = &nic;
- u8* base;
-#if defined(NE2000_BASIC_INIT)
- int i;
-#endif
-
- DEBUG_FUNCTION();
-
- base = dp->base;
- if (!base)
- return false; /* No device found */
-
- DEBUG_LINE();
-
-#if defined(NE2000_BASIC_INIT)
- /* AX88796L doesn't need */
- /* Prepare ESA */
- DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1); /* Select page 1 */
- /* Use the address from the serial EEPROM */
- for (i = 0; i < 6; i++)
- DP_IN(base, DP_P1_PAR0+i, dp->esa[i]);
- DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0); /* Select page 0 */
-
- printf("NE2000 - %s ESA: %02x:%02x:%02x:%02x:%02x:%02x\n",
- "eeprom",
- dp->esa[0],
- dp->esa[1],
- dp->esa[2],
- dp->esa[3],
- dp->esa[4],
- dp->esa[5] );
-
-#endif /* NE2000_BASIC_INIT */
- return true;
-}
-
-static void
-dp83902a_stop(void)
-{
- dp83902a_priv_data_t *dp = &nic;
- u8 *base = dp->base;
-
- DEBUG_FUNCTION();
-
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_STOP); /* Brutal */
- DP_OUT(base, DP_ISR, 0xFF); /* Clear any pending interrupts */
- DP_OUT(base, DP_IMR, 0x00); /* Disable all interrupts */
-
- dp->running = false;
-}
-
-/*
- * This function is called to "start up" the interface. It may be called
- * multiple times, even when the hardware is already running. It will be
- * called whenever something "hardware oriented" changes and should leave
- * the hardware ready to send/receive packets.
- */
-static void
-dp83902a_start(u8 * enaddr)
-{
- dp83902a_priv_data_t *dp = &nic;
- u8 *base = dp->base;
- int i;
-
- DEBUG_FUNCTION();
-
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_STOP); /* Brutal */
- DP_OUT(base, DP_DCR, DP_DCR_INIT);
- DP_OUT(base, DP_RBCH, 0); /* Remote byte count */
- DP_OUT(base, DP_RBCL, 0);
- DP_OUT(base, DP_RCR, DP_RCR_MON); /* Accept no packets */
- DP_OUT(base, DP_TCR, DP_TCR_LOCAL); /* Transmitter [virtually] off */
- DP_OUT(base, DP_TPSR, dp->tx_buf1); /* Transmitter start page */
- dp->tx1 = dp->tx2 = 0;
- dp->tx_next = dp->tx_buf1;
- dp->tx_started = false;
- dp->running = true;
- DP_OUT(base, DP_PSTART, dp->rx_buf_start); /* Receive ring start page */
- DP_OUT(base, DP_BNDRY, dp->rx_buf_end - 1); /* Receive ring boundary */
- DP_OUT(base, DP_PSTOP, dp->rx_buf_end); /* Receive ring end page */
- dp->rx_next = dp->rx_buf_start - 1;
- dp->running = true;
- DP_OUT(base, DP_ISR, 0xFF); /* Clear any pending interrupts */
- DP_OUT(base, DP_IMR, DP_IMR_All); /* Enable all interrupts */
- DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE1 | DP_CR_STOP); /* Select page 1 */
- DP_OUT(base, DP_P1_CURP, dp->rx_buf_start); /* Current page - next free page for Rx */
- dp->running = true;
- for (i = 0; i < ETHER_ADDR_LEN; i++) {
- /* FIXME */
- /*((vu_short*)( base + ((DP_P1_PAR0 + i) * 2) +
- * 0x1400)) = enaddr[i];*/
- DP_OUT(base, DP_P1_PAR0+i, enaddr[i]);
- }
- /* Enable and start device */
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
- DP_OUT(base, DP_TCR, DP_TCR_NORMAL); /* Normal transmit operations */
- DP_OUT(base, DP_RCR, DP_RCR_AB); /* Accept broadcast, no errors, no multicast */
- dp->running = true;
-}
-
-/*
- * This routine is called to start the transmitter. It is split out from the
- * data handling routine so it may be called either when data becomes first
- * available or when an Tx interrupt occurs
- */
-
-static void
-dp83902a_start_xmit(int start_page, int len)
-{
- dp83902a_priv_data_t *dp = (dp83902a_priv_data_t *) &nic;
- u8 *base = dp->base;
-
- DEBUG_FUNCTION();
-
-#if DEBUG & 1
- printf("Tx pkt %d len %d\n", start_page, len);
- if (dp->tx_started)
- printf("TX already started?!?\n");
-#endif
-
- DP_OUT(base, DP_ISR, (DP_ISR_TxP | DP_ISR_TxE));
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
- DP_OUT(base, DP_TBCL, len & 0xFF);
- DP_OUT(base, DP_TBCH, len >> 8);
- DP_OUT(base, DP_TPSR, start_page);
- DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_TXPKT | DP_CR_START);
-
- dp->tx_started = true;
-}
-
-/*
- * This routine is called to send data to the hardware. It is known a-priori
- * that there is free buffer space (dp->tx_next).
- */
-static void
-dp83902a_send(u8 *data, int total_len, u32 key)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
- u8 *base = dp->base;
- int len, start_page, pkt_len, i, isr;
-#if DEBUG & 4
- int dx;
-#endif
-
- DEBUG_FUNCTION();
-
- len = pkt_len = total_len;
- if (pkt_len < IEEE_8023_MIN_FRAME)
- pkt_len = IEEE_8023_MIN_FRAME;
-
- start_page = dp->tx_next;
- if (dp->tx_next == dp->tx_buf1) {
- dp->tx1 = start_page;
- dp->tx1_len = pkt_len;
- dp->tx1_key = key;
- dp->tx_next = dp->tx_buf2;
- } else {
- dp->tx2 = start_page;
- dp->tx2_len = pkt_len;
- dp->tx2_key = key;
- dp->tx_next = dp->tx_buf1;
- }
-
-#if DEBUG & 5
- printf("TX prep page %d len %d\n", start_page, pkt_len);
-#endif
-
- DP_OUT(base, DP_ISR, DP_ISR_RDC); /* Clear end of DMA */
- {
- /*
- * Dummy read. The manual sez something slightly different,
- * but the code is extended a bit to do what Hitachi's monitor
- * does (i.e., also read data).
- */
-
- u16 tmp;
- int len = 1;
-
- DP_OUT(base, DP_RSAL, 0x100 - len);
- DP_OUT(base, DP_RSAH, (start_page - 1) & 0xff);
- DP_OUT(base, DP_RBCL, len);
- DP_OUT(base, DP_RBCH, 0);
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_RDMA | DP_CR_START);
- DP_IN_DATA(dp->data, tmp);
- }
-
-#ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA
- /*
- * Stall for a bit before continuing to work around random data
- * corruption problems on some platforms.
- */
- CYGACC_CALL_IF_DELAY_US(1);
-#endif
-
- /* Send data to device buffer(s) */
- DP_OUT(base, DP_RSAL, 0);
- DP_OUT(base, DP_RSAH, start_page);
- DP_OUT(base, DP_RBCL, pkt_len & 0xFF);
- DP_OUT(base, DP_RBCH, pkt_len >> 8);
- DP_OUT(base, DP_CR, DP_CR_WDMA | DP_CR_START);
-
- /* Put data into buffer */
-#if DEBUG & 4
- printf(" sg buf %08lx len %08x\n ", (u32)data, len);
- dx = 0;
-#endif
- while (len > 0) {
-#if DEBUG & 4
- printf(" %02x", *data);
- if (0 == (++dx % 16)) printf("\n ");
-#endif
-
- DP_OUT_DATA(dp->data, *data++);
- len--;
- }
-#if DEBUG & 4
- printf("\n");
-#endif
- if (total_len < pkt_len) {
-#if DEBUG & 4
- printf(" + %d bytes of padding\n", pkt_len - total_len);
-#endif
- /* Padding to 802.3 length was required */
- for (i = total_len; i < pkt_len;) {
- i++;
- DP_OUT_DATA(dp->data, 0);
- }
- }
-
-#ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_TX_DMA
- /*
- * After last data write, delay for a bit before accessing the
- * device again, or we may get random data corruption in the last
- * datum (on some platforms).
- */
- CYGACC_CALL_IF_DELAY_US(1);
-#endif
-
- /* Wait for DMA to complete */
- do {
- DP_IN(base, DP_ISR, isr);
- } while ((isr & DP_ISR_RDC) == 0);
-
- /* Then disable DMA */
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
-
- /* Start transmit if not already going */
- if (!dp->tx_started) {
- if (start_page == dp->tx1) {
- dp->tx_int = 1; /* Expecting interrupt from BUF1 */
- } else {
- dp->tx_int = 2; /* Expecting interrupt from BUF2 */
- }
- dp83902a_start_xmit(start_page, pkt_len);
- }
-}
-
-/*
- * This function is called when a packet has been received. It's job is
- * to prepare to unload the packet from the hardware. Once the length of
- * the packet is known, the upper layer of the driver can be told. When
- * the upper layer is ready to unload the packet, the internal function
- * 'dp83902a_recv' will be called to actually fetch it from the hardware.
- */
-static void
-dp83902a_RxEvent(void)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
- u8 *base = dp->base;
- u8 rsr;
- u8 rcv_hdr[4];
- int i, len, pkt, cur;
-
- DEBUG_FUNCTION();
-
- DP_IN(base, DP_RSR, rsr);
- while (true) {
- /* Read incoming packet header */
- DP_OUT(base, DP_CR, DP_CR_PAGE1 | DP_CR_NODMA | DP_CR_START);
- DP_IN(base, DP_P1_CURP, cur);
- DP_OUT(base, DP_P1_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
- DP_IN(base, DP_BNDRY, pkt);
-
- pkt += 1;
- if (pkt == dp->rx_buf_end)
- pkt = dp->rx_buf_start;
-
- if (pkt == cur) {
- break;
- }
- DP_OUT(base, DP_RBCL, sizeof(rcv_hdr));
- DP_OUT(base, DP_RBCH, 0);
- DP_OUT(base, DP_RSAL, 0);
- DP_OUT(base, DP_RSAH, pkt);
- if (dp->rx_next == pkt) {
- if (cur == dp->rx_buf_start)
- DP_OUT(base, DP_BNDRY, dp->rx_buf_end - 1);
- else
- DP_OUT(base, DP_BNDRY, cur - 1); /* Update pointer */
- return;
- }
- dp->rx_next = pkt;
- DP_OUT(base, DP_ISR, DP_ISR_RDC); /* Clear end of DMA */
- DP_OUT(base, DP_CR, DP_CR_RDMA | DP_CR_START);
-#ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_RX_DMA
- CYGACC_CALL_IF_DELAY_US(10);
-#endif
-
- /* read header (get data size)*/
- for (i = 0; i < sizeof(rcv_hdr);) {
- DP_IN_DATA(dp->data, rcv_hdr[i++]);
- }
-
-#if DEBUG & 5
- printf("rx hdr %02x %02x %02x %02x\n",
- rcv_hdr[0], rcv_hdr[1], rcv_hdr[2], rcv_hdr[3]);
-#endif
- len = ((rcv_hdr[3] << 8) | rcv_hdr[2]) - sizeof(rcv_hdr);
-
- /* data read */
- uboot_push_packet_len(len);
-
- if (rcv_hdr[1] == dp->rx_buf_start)
- DP_OUT(base, DP_BNDRY, dp->rx_buf_end - 1);
- else
- DP_OUT(base, DP_BNDRY, rcv_hdr[1] - 1); /* Update pointer */
- }
-}
-
-/*
- * This function is called as a result of the "eth_drv_recv()" call above.
- * It's job is to actually fetch data for a packet from the hardware once
- * memory buffers have been allocated for the packet. Note that the buffers
- * may come in pieces, using a scatter-gather list. This allows for more
- * efficient processing in the upper layers of the stack.
- */
-static void
-dp83902a_recv(u8 *data, int len)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
- u8 *base = dp->base;
- int i, mlen;
- u8 saved_char = 0;
- bool saved;
-#if DEBUG & 4
- int dx;
-#endif
-
- DEBUG_FUNCTION();
-
-#if DEBUG & 5
- printf("Rx packet %d length %d\n", dp->rx_next, len);
-#endif
-
- /* Read incoming packet data */
- DP_OUT(base, DP_CR, DP_CR_PAGE0 | DP_CR_NODMA | DP_CR_START);
- DP_OUT(base, DP_RBCL, len & 0xFF);
- DP_OUT(base, DP_RBCH, len >> 8);
- DP_OUT(base, DP_RSAL, 4); /* Past header */
- DP_OUT(base, DP_RSAH, dp->rx_next);
- DP_OUT(base, DP_ISR, DP_ISR_RDC); /* Clear end of DMA */
- DP_OUT(base, DP_CR, DP_CR_RDMA | DP_CR_START);
-#ifdef CYGHWR_NS_DP83902A_PLF_BROKEN_RX_DMA
- CYGACC_CALL_IF_DELAY_US(10);
-#endif
-
- saved = false;
- for (i = 0; i < 1; i++) {
- if (data) {
- mlen = len;
-#if DEBUG & 4
- printf(" sg buf %08lx len %08x \n", (u32) data, mlen);
- dx = 0;
-#endif
- while (0 < mlen) {
- /* Saved byte from previous loop? */
- if (saved) {
- *data++ = saved_char;
- mlen--;
- saved = false;
- continue;
- }
-
- {
- u8 tmp;
- DP_IN_DATA(dp->data, tmp);
-#if DEBUG & 4
- printf(" %02x", tmp);
- if (0 == (++dx % 16)) printf("\n ");
-#endif
- *data++ = tmp;;
- mlen--;
- }
- }
-#if DEBUG & 4
- printf("\n");
-#endif
- }
- }
-}
-
-static void
-dp83902a_TxEvent(void)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
- u8 *base = dp->base;
- u8 tsr;
- u32 key;
-
- DEBUG_FUNCTION();
-
- DP_IN(base, DP_TSR, tsr);
- if (dp->tx_int == 1) {
- key = dp->tx1_key;
- dp->tx1 = 0;
- } else {
- key = dp->tx2_key;
- dp->tx2 = 0;
- }
- /* Start next packet if one is ready */
- dp->tx_started = false;
- if (dp->tx1) {
- dp83902a_start_xmit(dp->tx1, dp->tx1_len);
- dp->tx_int = 1;
- } else if (dp->tx2) {
- dp83902a_start_xmit(dp->tx2, dp->tx2_len);
- dp->tx_int = 2;
- } else {
- dp->tx_int = 0;
- }
- /* Tell higher level we sent this packet */
- uboot_push_tx_done(key, 0);
-}
-
-/*
- * Read the tally counters to clear them. Called in response to a CNT
- * interrupt.
- */
-static void
-dp83902a_ClearCounters(void)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
- u8 *base = dp->base;
- u8 cnt1, cnt2, cnt3;
-
- DP_IN(base, DP_FER, cnt1);
- DP_IN(base, DP_CER, cnt2);
- DP_IN(base, DP_MISSED, cnt3);
- DP_OUT(base, DP_ISR, DP_ISR_CNT);
-}
-
-/*
- * Deal with an overflow condition. This code follows the procedure set
- * out in section 7.0 of the datasheet.
- */
-static void
-dp83902a_Overflow(void)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *)&nic;
- u8 *base = dp->base;
- u8 isr;
-
- /* Issue a stop command and wait 1.6ms for it to complete. */
- DP_OUT(base, DP_CR, DP_CR_STOP | DP_CR_NODMA);
- CYGACC_CALL_IF_DELAY_US(1600);
-
- /* Clear the remote byte counter registers. */
- DP_OUT(base, DP_RBCL, 0);
- DP_OUT(base, DP_RBCH, 0);
-
- /* Enter loopback mode while we clear the buffer. */
- DP_OUT(base, DP_TCR, DP_TCR_LOCAL);
- DP_OUT(base, DP_CR, DP_CR_START | DP_CR_NODMA);
-
- /*
- * Read in as many packets as we can and acknowledge any and receive
- * interrupts. Since the buffer has overflowed, a receive event of
- * some kind will have occured.
- */
- dp83902a_RxEvent();
- DP_OUT(base, DP_ISR, DP_ISR_RxP|DP_ISR_RxE);
-
- /* Clear the overflow condition and leave loopback mode. */
- DP_OUT(base, DP_ISR, DP_ISR_OFLW);
- DP_OUT(base, DP_TCR, DP_TCR_NORMAL);
-
- /*
- * If a transmit command was issued, but no transmit event has occured,
- * restart it here.
- */
- DP_IN(base, DP_ISR, isr);
- if (dp->tx_started && !(isr & (DP_ISR_TxP|DP_ISR_TxE))) {
- DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_TXPKT | DP_CR_START);
- }
-}
-
-static void
-dp83902a_poll(void)
-{
- struct dp83902a_priv_data *dp = (struct dp83902a_priv_data *) &nic;
- u8 *base = dp->base;
- u8 isr;
-
- DP_OUT(base, DP_CR, DP_CR_NODMA | DP_CR_PAGE0 | DP_CR_START);
- DP_IN(base, DP_ISR, isr);
- while (0 != isr) {
- /*
- * The CNT interrupt triggers when the MSB of one of the error
- * counters is set. We don't much care about these counters, but
- * we should read their values to reset them.
- */
- if (isr & DP_ISR_CNT) {
- dp83902a_ClearCounters();
- }
- /*
- * Check for overflow. It's a special case, since there's a
- * particular procedure that must be followed to get back into
- * a running state.a
- */
- if (isr & DP_ISR_OFLW) {
- dp83902a_Overflow();
- } else {
- /*
- * Other kinds of interrupts can be acknowledged simply by
- * clearing the relevant bits of the ISR. Do that now, then
- * handle the interrupts we care about.
- */
- DP_OUT(base, DP_ISR, isr); /* Clear set bits */
- if (!dp->running) break; /* Is this necessary? */
- /*
- * Check for tx_started on TX event since these may happen
- * spuriously it seems.
- */
- if (isr & (DP_ISR_TxP|DP_ISR_TxE) && dp->tx_started) {
- dp83902a_TxEvent();
- }
- if (isr & (DP_ISR_RxP|DP_ISR_RxE)) {
- dp83902a_RxEvent();
- }
- }
- DP_IN(base, DP_ISR, isr);
- }
-}
-
+#define mdelay(n) udelay((n)*1000)
/* find prom (taken from pc_net_cs.c from Linux) */
#include "8390.h"
@@ -763,18 +174,16 @@ static hw_info_t hw_info[] = {
#define PCNET_RESET 0x1f /* Issue a read to reset, a write to clear. */
#define PCNET_MISC 0x18 /* For IBM CCAE and Socket EA cards */
-static void pcnet_reset_8390(void)
+static void pcnet_reset_8390(u8* addr)
{
int i, r;
- PRINTK("nic base is %lx\n", nic.base);
-
n2k_outb(E8390_NODMA + E8390_PAGE0+E8390_STOP, E8390_CMD);
- PRINTK("cmd (at %lx) is %x\n", nic.base + E8390_CMD, n2k_inb(E8390_CMD));
+ PRINTK("cmd (at %lx) is %x\n", addr + E8390_CMD, n2k_inb(E8390_CMD));
n2k_outb(E8390_NODMA+E8390_PAGE1+E8390_STOP, E8390_CMD);
- PRINTK("cmd (at %lx) is %x\n", nic.base + E8390_CMD, n2k_inb(E8390_CMD));
+ PRINTK("cmd (at %lx) is %x\n", addr + E8390_CMD, n2k_inb(E8390_CMD));
n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
- PRINTK("cmd (at %lx) is %x\n", nic.base + E8390_CMD, n2k_inb(E8390_CMD));
+ PRINTK("cmd (at %lx) is %x\n", addr + E8390_CMD, n2k_inb(E8390_CMD));
n2k_outb(E8390_NODMA+E8390_PAGE0+E8390_STOP, E8390_CMD);
n2k_outb(n2k_inb(PCNET_RESET), PCNET_RESET);
@@ -791,8 +200,7 @@ static void pcnet_reset_8390(void)
printf("pcnet_reset_8390() did not complete.\n");
} /* pcnet_reset_8390 */
-int get_prom(u8* mac_addr) __attribute__ ((weak, alias ("__get_prom")));
-int __get_prom(u8* mac_addr)
+int get_prom(u8* mac_addr, u8* base_addr)
{
u8 prom[32];
int i, j;
@@ -816,7 +224,7 @@ int __get_prom(u8* mac_addr)
PRINTK ("trying to get MAC via prom reading\n");
- pcnet_reset_8390 ();
+ pcnet_reset_8390 (base_addr);
mdelay (10);
@@ -849,116 +257,3 @@ int __get_prom(u8* mac_addr)
}
return 0;
}
-
-/* U-boot specific routines */
-static u8 *pbuf = NULL;
-
-static int pkey = -1;
-static int initialized = 0;
-
-void uboot_push_packet_len(int len) {
- PRINTK("pushed len = %d\n", len);
- if (len >= 2000) {
- printf("NE2000: packet too big\n");
- return;
- }
- dp83902a_recv(&pbuf[0], len);
-
- /*Just pass it to the upper layer*/
- NetReceive(&pbuf[0], len);
-}
-
-void uboot_push_tx_done(int key, int val) {
- PRINTK("pushed key = %d\n", key);
- pkey = key;
-}
-
-int eth_init(bd_t *bd) {
- int r;
- u8 dev_addr[6];
- char ethaddr[20];
-
- PRINTK("### eth_init\n");
-
- if (!pbuf) {
- pbuf = malloc(2000);
- if (!pbuf) {
- printf("Cannot allocate rx buffer\n");
- return -1;
- }
- }
-
-#ifdef CONFIG_DRIVER_NE2000_CCR
- {
- vu_char *p = (vu_char *) CONFIG_DRIVER_NE2000_CCR;
-
- PRINTK("CCR before is %x\n", *p);
- *p = CONFIG_DRIVER_NE2000_VAL;
- PRINTK("CCR after is %x\n", *p);
- }
-#endif
-
- nic.base = (u8 *) CONFIG_DRIVER_NE2000_BASE;
-
- r = get_prom(dev_addr);
- if (!r)
- return -1;
-
- sprintf (ethaddr, "%02X:%02X:%02X:%02X:%02X:%02X",
- dev_addr[0], dev_addr[1],
- dev_addr[2], dev_addr[3],
- dev_addr[4], dev_addr[5]) ;
- PRINTK("Set environment from HW MAC addr = \"%s\"\n", ethaddr);
- setenv ("ethaddr", ethaddr);
-
- nic.data = nic.base + DP_DATA;
- nic.tx_buf1 = START_PG;
- nic.tx_buf2 = START_PG2;
- nic.rx_buf_start = RX_START;
- nic.rx_buf_end = RX_END;
-
- if (dp83902a_init() == false)
- return -1;
-
- dp83902a_start(dev_addr);
- initialized = 1;
-
- return 0;
-}
-
-void eth_halt() {
-
- PRINTK("### eth_halt\n");
- if(initialized)
- dp83902a_stop();
- initialized = 0;
-}
-
-int eth_rx() {
- dp83902a_poll();
- return 1;
-}
-
-int eth_send(volatile void *packet, int length) {
- int tmo;
-
- PRINTK("### eth_send\n");
-
- pkey = -1;
-
- dp83902a_send((u8 *) packet, length, 666);
- tmo = get_timer (0) + TOUT * CFG_HZ;
- while(1) {
- dp83902a_poll();
- if (pkey != -1) {
- PRINTK("Packet sucesfully sent\n");
- return 0;
- }
- if (get_timer (0) >= tmo) {
- printf("transmission error (timoeut)\n");
- return 0;
- }
-
- }
- return 0;
-}
diff --git a/drivers/net/ne2000_base.h b/drivers/net/ne2000_base.h
index 948b290..5446de4 100644
--- a/drivers/net/ne2000_base.h
+++ b/drivers/net/ne2000_base.h
@@ -80,10 +80,35 @@ are GPL, so this is, of course, GPL.
#define __NE2000_BASE_H__
#define bool int
-
#define false 0
#define true 1
+/*
+ * Debugging details
+ *
+ * Set to perms of:
+ * 0 disables all debug output
+ * 1 for process debug output
+ * 2 for added data IO output: get_reg, put_reg
+ * 4 for packet allocation/free output
+ * 8 for only startup status, so we can tell we're installed OK
+ */
+#if 0
+#define DEBUG 0xf
+#else
+#define DEBUG 0
+#endif
+
+#if DEBUG & 1
+#define DEBUG_FUNCTION() do { printf("%s\n", __FUNCTION__); } while (0)
+#define DEBUG_LINE() do { printf("%d\n", __LINE__); } while (0)
+#define PRINTK(args...) printf(args)
+#else
+#define DEBUG_FUNCTION() do {} while(0)
+#define DEBUG_LINE() do {} while(0)
+#define PRINTK(args...)
+#endif
+
/* timeout for tx/rx in s */
#define TOUT 5
/* Ether MAC address size */
@@ -119,11 +144,6 @@ typedef struct dp83902a_priv_data {
int rx_buf_start, rx_buf_end;
} dp83902a_priv_data_t;
-/*
- * Some forward declarations
- */
-static void dp83902a_poll(void);
-
/* ------------------------------------------------------------------------ */
/* Register offsets */
@@ -281,4 +301,8 @@ static void dp83902a_poll(void);
#define IEEE_8023_MAX_FRAME 1518 /* Largest possible ethernet frame */
#define IEEE_8023_MIN_FRAME 64 /* Smallest possible ethernet frame */
+
+/* Functions */
+int get_prom(u8* mac_addr, u8* base_addr);
+
#endif /* __NE2000_BASE_H__ */
--
1.5.6.2
3
2

[U-Boot] [PATCH] ARM - Integrator[AP/CP] - - Correct Improper ulong division
by Gururaja Hebbar K R 13 Oct '08
by Gururaja Hebbar K R 13 Oct '08
13 Oct '08
Hi,
- Correct Improper ulong division. This patch take care of
multiple definition of `__udivsi3' & undefined reference to `raise' Error
when compiling [ap/cp]926ejs_config with CodeSourcery arm toolchain
Signed-off-by: Gururaja Hebbar <gururajakr(a)sanyo.co.in>
---
board/integratorap/integratorap.c | 7 +++++--
board/integratorcp/integratorcp.c | 7 +++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/board/integratorap/integratorap.c b/board/integratorap/integratorap.c
index e659907..421cdbb 100755
--- a/board/integratorap/integratorap.c
+++ b/board/integratorap/integratorap.c
@@ -611,6 +611,7 @@ void reset_timer_masked (void)
ulong get_timer_masked (void)
{
ulong now = READ_TIMER; /* current count */
+ unsigned long long n;
if (now > lastdec) {
/* Must have wrapped */
@@ -618,8 +619,10 @@ ulong get_timer_masked (void)
} else {
total_count += lastdec - now;
}
- lastdec = now;
- timestamp = total_count/div_timer;
+ lastdec = now;
+ n = total_count;
+ do_div(n, div_timer);
+ timestamp = (ulong)n;
return timestamp;
}
diff --git a/board/integratorcp/integratorcp.c b/board/integratorcp/integratorcp.c
index d6d6e13..8d85238 100755
--- a/board/integratorcp/integratorcp.c
+++ b/board/integratorcp/integratorcp.c
@@ -236,6 +236,7 @@ ulong get_timer_masked (void)
{
/* get current count */
unsigned long long now = (unsigned long long)READ_TIMER;
+ unsigned long long n;
if(now > lastdec) {
/* Must have wrapped */
@@ -243,8 +244,10 @@ ulong get_timer_masked (void)
} else {
total_count += lastdec - now;
}
- lastdec = now;
- timestamp = (ulong)(total_count/div_timer);
+ lastdec = now;
+ n = total_count;
+ do_div(n, div_timer);
+ timestamp = (ulong)n;
return timestamp;
}
--
1.5.6.4
2
1

[U-Boot] [PATCH][Re-submit] Hardware watchdog support for AT91SAM9260 CPU
by Sergey Lapin 13 Oct '08
by Sergey Lapin 13 Oct '08
13 Oct '08
Signed-off-by: Sergey Lapin <slapin(a)ossfans.org>
---
cpu/arm926ejs/at91/Makefile | 1 +
cpu/arm926ejs/at91/watchdog.c | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 0 deletions(-)
create mode 100644 cpu/arm926ejs/at91/watchdog.c
diff --git a/cpu/arm926ejs/at91/Makefile b/cpu/arm926ejs/at91/Makefile
index 44cde1a..7befcd7 100644
--- a/cpu/arm926ejs/at91/Makefile
+++ b/cpu/arm926ejs/at91/Makefile
@@ -29,6 +29,7 @@ COBJS-y += ether.o
COBJS-y += timer.o
COBJS-$(CONFIG_HAS_DATAFLASH) +=spi.o
COBJS-y += usb.o
+COBJS-$(CONFIG_HW_WATCHDOG) +=watchdog.o
SOBJS = lowlevel_init.o
SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
diff --git a/cpu/arm926ejs/at91/watchdog.c b/cpu/arm926ejs/at91/watchdog.c
new file mode 100644
index 0000000..502cc8a
--- /dev/null
+++ b/cpu/arm926ejs/at91/watchdog.c
@@ -0,0 +1,38 @@
+/*
+ * watchdog.c - driver for at91sam9260 watchdog
+ *
+ * Copyright (c) 2008 Sergey Lapin
+ *
+ * Based on Blackfin watchdog driver
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include <common.h>
+#include <watchdog.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/io.h>
+
+#ifdef CONFIG_HW_WATCHDOG
+#define AT91_WDT_CR (AT91_WDT+0x00)
+#define AT91_WDT_MR (AT91_WDT+0x04)
+#define AT91_WDT_SR (AT91_WDT+0x08)
+
+void hw_watchdog_reset(void)
+{
+ at91_sys_write(AT91_WDT_CR, 0xa5000001);
+}
+
+void hw_watchdog_init(void)
+{
+ /* 16 seconds timer, resets enabled */
+ at91_sys_write(AT91_WDT_MR, 0x3FFF2FFF);
+}
+
+void hw_watchdog_disable(void)
+{
+ /* Can't reenable per documentation */
+ at91_sys_write(AT91_WDT_MR, 0x8000);
+}
+#endif
+
--
1.5.4.1
2
1
* Cleaned up asm-arm/sizes.h.
* Removed sloppy copies of the above file in several arch subdirectories.
Signed-off-by: Adrian Filipi <adrian.filipi(a)eurotech.com>
---
include/asm-arm/arch-arm925t/sizes.h | 50
----------------------------
include/asm-arm/arch-arm926ejs/sizes.h | 51
-----------------------------
include/asm-arm/arch-omap/sizes.h | 52
------------------------------
include/asm-arm/arch-omap24xx/omap2420.h | 2 +-
include/asm-arm/arch-omap24xx/sizes.h | 49
----------------------------
include/asm-arm/sizes.h | 51
++++++++++++++---------------
include/configs/h2_p2_dbg_board.h | 2 +-
include/configs/omap1510.h | 2 +-
include/configs/omap730.h | 2 +-
9 files changed, 28 insertions(+), 233 deletions(-)
delete mode 100644 include/asm-arm/arch-arm925t/sizes.h
delete mode 100644 include/asm-arm/arch-arm926ejs/sizes.h
delete mode 100644 include/asm-arm/arch-omap/sizes.h
delete mode 100644 include/asm-arm/arch-omap24xx/sizes.h
diff --git a/include/asm-arm/arch-arm925t/sizes.h
b/include/asm-arm/arch-arm925t/sizes.h
deleted file mode 100644
index 7319bd9..0000000
--- a/include/asm-arm/arch-arm925t/sizes.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
- */
-/* DO NOT EDIT!! - this file automatically generated
- * from .s file by awk -f s2h.awk
- */
-/* Size defintions
- * Copyright (C) ARM Limited 1998. All rights reserved.
- */
-
-#ifndef __sizes_h
-#define __sizes_h 1
-
-/* handy sizes */
-#define SZ_1K 0x00000400
-#define SZ_4K 0x00001000
-#define SZ_8K 0x00002000
-#define SZ_16K 0x00004000
-#define SZ_64K 0x00010000
-#define SZ_128K 0x00020000
-#define SZ_256K 0x00040000
-#define SZ_512K 0x00080000
-
-#define SZ_1M 0x00100000
-#define SZ_2M 0x00200000
-#define SZ_4M 0x00400000
-#define SZ_8M 0x00800000
-#define SZ_16M 0x01000000
-#define SZ_32M 0x02000000
-#define SZ_64M 0x04000000
-#define SZ_128M 0x08000000
-#define SZ_256M 0x10000000
-#define SZ_512M 0x20000000
-
-#define SZ_1G 0x40000000
-#define SZ_2G 0x80000000
-
-#endif /* __sizes_h */
diff --git a/include/asm-arm/arch-arm926ejs/sizes.h
b/include/asm-arm/arch-arm926ejs/sizes.h
deleted file mode 100644
index ef0b99b..0000000
--- a/include/asm-arm/arch-arm926ejs/sizes.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA0 2111-1307
- * USA
- */
-/* DO NOT EDIT!! - this file automatically generated
- * from .s file by awk -f s2h.awk
- */
-/* Size defintions
- * Copyright (C) ARM Limited 1998. All rights reserved.
- */
-
-#ifndef __sizes_h
-#define __sizes_h 1
-
-/* handy sizes */
-#define SZ_1K 0x00000400
-#define SZ_4K 0x00001000
-#define SZ_8K 0x00002000
-#define SZ_16K 0x00004000
-#define SZ_64K 0x00010000
-#define SZ_128K 0x00020000
-#define SZ_256K 0x00040000
-#define SZ_512K 0x00080000
-
-#define SZ_1M 0x00100000
-#define SZ_2M 0x00200000
-#define SZ_4M 0x00400000
-#define SZ_8M 0x00800000
-#define SZ_16M 0x01000000
-#define SZ_32M 0x02000000
-#define SZ_64M 0x04000000
-#define SZ_128M 0x08000000
-#define SZ_256M 0x10000000
-#define SZ_512M 0x20000000
-
-#define SZ_1G 0x40000000
-#define SZ_2G 0x80000000
-
-#endif /* __sizes_h */
diff --git a/include/asm-arm/arch-omap/sizes.h
b/include/asm-arm/arch-omap/sizes.h
deleted file mode 100644
index f8d92ca..0000000
--- a/include/asm-arm/arch-omap/sizes.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
- */
-/* DO NOT EDIT!! - this file automatically generated
- * from .s file by awk -f s2h.awk
- */
-/* Size defintions
- * Copyright (C) ARM Limited 1998. All rights reserved.
- */
-
-#ifndef __sizes_h
-#define __sizes_h 1
-
-/* handy sizes */
-#define SZ_1K 0x00000400
-#define SZ_4K 0x00001000
-#define SZ_8K 0x00002000
-#define SZ_16K 0x00004000
-#define SZ_64K 0x00010000
-#define SZ_128K 0x00020000
-#define SZ_256K 0x00040000
-#define SZ_512K 0x00080000
-
-#define SZ_1M 0x00100000
-#define SZ_2M 0x00200000
-#define SZ_4M 0x00400000
-#define SZ_8M 0x00800000
-#define SZ_16M 0x01000000
-#define SZ_32M 0x02000000
-#define SZ_64M 0x04000000
-#define SZ_128M 0x08000000
-#define SZ_256M 0x10000000
-#define SZ_512M 0x20000000
-
-#define SZ_1G 0x40000000
-#define SZ_2G 0x80000000
-
-#endif
-
-/* END */
diff --git a/include/asm-arm/arch-omap24xx/omap2420.h
b/include/asm-arm/arch-omap24xx/omap2420.h
index 0c11bec..6032419 100644
--- a/include/asm-arm/arch-omap24xx/omap2420.h
+++ b/include/asm-arm/arch-omap24xx/omap2420.h
@@ -25,7 +25,7 @@
#ifndef _OMAP2420_SYS_H_
#define _OMAP2420_SYS_H_
-#include <asm/arch/sizes.h>
+#include <asm/sizes.h>
/*
* 2420 specific Section
diff --git a/include/asm-arm/arch-omap24xx/sizes.h
b/include/asm-arm/arch-omap24xx/sizes.h
deleted file mode 100644
index aaba18f..0000000
--- a/include/asm-arm/arch-omap24xx/sizes.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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 2 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
- */
-/* Size defintions
- * Copyright (C) ARM Limited 1998. All rights reserved.
- */
-
-#ifndef __sizes_h
-#define __sizes_h 1
-
-/* handy sizes */
-#define SZ_1K 0x00000400
-#define SZ_4K 0x00001000
-#define SZ_8K 0x00002000
-#define SZ_16K 0x00004000
-#define SZ_32K 0x00008000
-#define SZ_64K 0x00010000
-#define SZ_128K 0x00020000
-#define SZ_256K 0x00040000
-#define SZ_512K 0x00080000
-
-#define SZ_1M 0x00100000
-#define SZ_2M 0x00200000
-#define SZ_4M 0x00400000
-#define SZ_8M 0x00800000
-#define SZ_16M 0x01000000
-#define SZ_31M 0x01F00000
-#define SZ_32M 0x02000000
-#define SZ_64M 0x04000000
-#define SZ_128M 0x08000000
-#define SZ_256M 0x10000000
-#define SZ_512M 0x20000000
-
-#define SZ_1G 0x40000000
-#define SZ_2G 0x80000000
-
-#endif /* __sizes_h */
diff --git a/include/asm-arm/sizes.h b/include/asm-arm/sizes.h
index f8d92ca..1ffb327 100644
--- a/include/asm-arm/sizes.h
+++ b/include/asm-arm/sizes.h
@@ -13,40 +13,37 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA
*/
-/* DO NOT EDIT!! - this file automatically generated
- * from .s file by awk -f s2h.awk
- */
/* Size defintions
* Copyright (C) ARM Limited 1998. All rights reserved.
*/
#ifndef __sizes_h
-#define __sizes_h 1
+#define __sizes_h 1
/* handy sizes */
-#define SZ_1K 0x00000400
-#define SZ_4K 0x00001000
-#define SZ_8K 0x00002000
-#define SZ_16K 0x00004000
-#define SZ_64K 0x00010000
-#define SZ_128K 0x00020000
-#define SZ_256K 0x00040000
-#define SZ_512K 0x00080000
-
-#define SZ_1M 0x00100000
-#define SZ_2M 0x00200000
-#define SZ_4M 0x00400000
-#define SZ_8M 0x00800000
-#define SZ_16M 0x01000000
-#define SZ_32M 0x02000000
-#define SZ_64M 0x04000000
-#define SZ_128M 0x08000000
-#define SZ_256M 0x10000000
-#define SZ_512M 0x20000000
+#define SZ_1K 0x00000400
+#define SZ_4K 0x00001000
+#define SZ_8K 0x00002000
+#define SZ_16K 0x00004000
+#define SZ_32K 0x00008000
+#define SZ_64K 0x00010000
+#define SZ_128K 0x00020000
+#define SZ_256K 0x00040000
+#define SZ_512K 0x00080000
-#define SZ_1G 0x40000000
-#define SZ_2G 0x80000000
+#define SZ_1M 0x00100000
+#define SZ_2M 0x00200000
+#define SZ_4M 0x00400000
+#define SZ_8M 0x00800000
+#define SZ_16M 0x01000000
+#define SZ_31M 0x01F00000
+#define SZ_32M 0x02000000
+#define SZ_64M 0x04000000
+#define SZ_128M 0x08000000
+#define SZ_256M 0x10000000
+#define SZ_512M 0x20000000
-#endif
+#define SZ_1G 0x40000000
+#define SZ_2G 0x80000000
-/* END */
+#endif /* __sizes_h */
diff --git a/include/configs/h2_p2_dbg_board.h
b/include/configs/h2_p2_dbg_board.h
index e0d823f..a4dea7d 100644
--- a/include/configs/h2_p2_dbg_board.h
+++ b/include/configs/h2_p2_dbg_board.h
@@ -31,7 +31,7 @@
#ifndef __INCLUDED_H2_P2_DBH_BOARD_H
#define __INCLUDED_H2_P2_DBH_BOARD_H
-#include <asm/arch/sizes.h>
+#include <asm/sizes.h>
/*
* The Debug board is designed to function with the P2 Sample, H2
diff --git a/include/configs/omap1510.h b/include/configs/omap1510.h
index 6787b19..9979453 100644
--- a/include/configs/omap1510.h
+++ b/include/configs/omap1510.h
@@ -28,7 +28,7 @@
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <asm/arch/sizes.h>
+#include <asm/sizes.h>
/*
There are 2 sets of general I/O -->
diff --git a/include/configs/omap730.h b/include/configs/omap730.h
index 03abcb3..2d11d50 100644
--- a/include/configs/omap730.h
+++ b/include/configs/omap730.h
@@ -31,7 +31,7 @@
#ifndef __INCLUDED_OMAP730_H
#define __INCLUDED_OMAP730_H
-#include <asm/arch/sizes.h>
+#include <asm/sizes.h>
/***************************************************************************
* OMAP730 Configuration Registers
--
1.5.6
2
3
Hi, all!
I have 2 questions about AT91 architecture in u-boot.
1. In file include/dataflash.h there is setting
#define NB_DATAFLASH_AREA 5
What is its real meaning? What if I need to change number of DataFlash
partitions? Probably it should be made board-specific?
2. What is current state with hardware ECC for NAND on at91 CPUs?
And, is there some ideas on how could I make such an image using
mtd-tools' mkfs.jffs2? When I flashed normal image and used hardware ECC
in kernel I have got lots of ECC errors and kernel not mounting rootfs.
BTW, will hardware ECC help me with big NAND (1GB) and lots of system logging
to speed-up stuff?
Thanks a lot,
S.
2
1
Hi,
I was trying to use u-boot for imx27 board. But I was not able to find uboot
for the same board. Only one available is
<http://git.denx.de/?p=u-boot/u-boot-v2.git;a=summary> u-boot/u-boot-v2.git
but I was not able to download the same using the git tool. Any help would
be appreciated.
Thanks,
Lejin
4
12
Hello u-boot-users,
I am currently in the process of developing a new driver in U-Boot. It
is a software "virtual ethernet over PCI" driver. The driver itself is
largely irrelevant for this problem.
During the development, I noticed that adding and removing certain
pieces of debugging code (which did not change any program state) caused
the board to hang on boot, like so:
================================================================================
U-Boot 1.3.4-rc1-00001-gb89881c-dirty (Jul 16 2008 - 14:54:56) MPC83XX
Reset Status: External/Internal Soft, External/Internal Hard
CPU: e300c1, MPC8349EA, Rev: 3.0 at 528 MHz, CSB: 264 MHz
Board: Freescale MPC8349EMDS
I2C:
As opposed to a normal boot:
================================================================================
U-Boot 1.3.4-rc1-00001-g8ff17d3-dirty (Jul 16 2008 - 12:00:01) MPC83XX
Reset Status: External/Internal Soft, External/Internal Hard
CPU: e300c1, MPC8349EA, Rev: 3.0 at 528 MHz, CSB: 264 MHz
Board: Freescale MPC8349EMDS
I2C: ready
SPI: ready
DRAM: 256 MB (DDR2, 64-bit, ECC on, 264 MHz)
FLASH: 32 MB
In: serial
Out: serial
Err: serial
Net: TSEC0, TSEC1
Type "run flash_nfs" to mount root filesystem over NFS
I have tried to narrow the problem down as much as possible, by removing
as much of my code as possible. I succeeded in reproducing the problem
using code that seemingly "does nothing wrong". The inlined patch is
against U-Boot v1.3.4-rc1
During my testing, it seemed that elf section alignment in the image
mattered. I took a broken, non-booting image and saved the section
offsets. They are reproduced below, generated with:
$ powerpc-linux-strip u-boot
$ powerpc-linux-readelf -e u-boot
Here is the output of the readelf command for my bad image:
================================================================================
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: PowerPC
Version: 0x1
Entry point address: 0xfe000100
Start of program headers: 52 (bytes into file)
Start of section headers: 225328 (bytes into file)
Flags: 0x8000, relocatable-lib
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 12
Section header string table index: 11
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS fe000000 000078 032c50 00 AX 0 0 4
[ 2] .reloc PROGBITS fe033000 033078 0014c0 00 WA 0 0 1
[ 3] .data PROGBITS fe0344c0 034538 000bdc 00 WA 0 0 4
[ 4] .data.rel.ro.loca PROGBITS fe03509c 035114 000078 00 WA 0 0 4
[ 5] .data.rel PROGBITS fe035114 03518c 000710 00 WA 0 0 4
[ 6] data PROGBITS fe035824 03589c 000004 00 WA 0 0 4
[ 7] .data.rel.local PROGBITS fe035828 0358a0 000be4 00 WA 0 0 4
[ 8] .u_boot_cmd PROGBITS fe03640c 036484 000570 00 WA 0 0 4
[ 9] .bss NOBITS fe037000 000000 0068e0 00 WA 0 0 8
[10] .comment PROGBITS 00000000 0369f4 0005d6 00 0 0 1
[11] .shstrtab STRTAB 00000000 036fca 000065 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000078 0xfe000000 0xfe000000 0x3697c 0x3697c RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
Section to Segment mapping:
Segment Sections...
00 .text .reloc .data .data.rel.ro.local .data.rel data .data.rel.local .u_boot_cmd
01
The part I found important was the size of each section. The .bss,
.comment, and .shstrtab don't seem to matter (but I may be wrong!)
I wrote some code that went into the appropriate sections to get the
sizes I needed. This is why there are lots of "a" in the patch (to boost
the .data section) and the extern variables (to boost the .reloc
section) and the extern variables with values (to boost the data section).
I also did my best to trim down the code that was added in
board/freescale/mpc8349emds/mpc8394emds.c checkboard(). In my original
code, all of the code is there. I left it there in the patch, but
#if 0'd out all of the parts that made no difference.
Removing the BCSR read does seem to fix the problem (while concurrently
adjusting the padding bits until the sections are the correct size). I
see nothing wrong with the BCSR read, and it may just be another
unrelated symptom.
Here is the readelf output on my non-working U-Boot binary (produced
from v1.3.4-rc1 + the attached patch), produced using the exact same
procedure as above:
================================================================================
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: PowerPC
Version: 0x1
Entry point address: 0xfe000100
Start of program headers: 52 (bytes into file)
Start of section headers: 225232 (bytes into file)
Flags: 0x8000, relocatable-lib
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 12
Section header string table index: 11
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .text PROGBITS fe000000 000078 032c50 00 AX 0 0 4
[ 2] .reloc PROGBITS fe033000 033078 0014c0 00 WA 0 0 1
[ 3] .data PROGBITS fe0344c0 034538 000bdc 00 WA 0 0 4
[ 4] .data.rel.ro.loca PROGBITS fe03509c 035114 000078 00 WA 0 0 4
[ 5] .data.rel PROGBITS fe035114 03518c 000710 00 WA 0 0 4
[ 6] data PROGBITS fe035824 03589c 000004 00 WA 0 0 4
[ 7] .data.rel.local PROGBITS fe035828 0358a0 000be4 00 WA 0 0 4
[ 8] .u_boot_cmd PROGBITS fe03640c 036484 000558 00 WA 0 0 4
[ 9] .bss NOBITS fe037000 000000 0068f0 00 WA 0 0 8
[10] .comment PROGBITS 00000000 0369dc 00058e 00 0 0 1
[11] .shstrtab STRTAB 00000000 036f6a 000065 00 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000078 0xfe000000 0xfe000000 0x36964 0x36964 RWE 0x8
GNU_STACK 0x000000 0x00000000 0x00000000 0x00000 0x00000 RWE 0x4
Section to Segment mapping:
Segment Sections...
00 .text .reloc .data .data.rel.ro.local .data.rel data .data.rel.local .u_boot_cmd
01
I built U-Boot using ELDK-4.2, using the following:
$ make mrproper
$ make MPC8349EMDS_config
My board is a Freescale MPC8349EMDS evaluation board.
If you need any more information, I am happy to provide it.
I appreciate any help in tracking down this problem,
Ira Snyder
Here is the patch (I apologize for the 100 character "a" lines, but they
made counting the correct number much easier)
================================================================================
>From c537102983b207ad0855309aeb214a5a08cb0a4e Mon Sep 17 00:00:00 2001
From: Ira W. Snyder <iws(a)ovro.caltech.edu>
Date: Wed, 16 Jul 2008 11:58:16 -0700
Subject: [PATCH] Simplified brokenness
This patch breaks the MPC8349EMDS board boot, using as simple of
code as I could manage to find.
Signed-off-by: Ira W. Snyder <iws(a)ovro.caltech.edu>
---
board/freescale/mpc8349emds/mpc8349emds.c | 21 ++
cpu/mpc83xx/cpu.c | 2 +
drivers/net/Makefile | 1 +
drivers/net/pcinet.c | 428 +++++++++++++++++++++++++++++
drivers/net/pcinet2.c | 133 +++++++++
5 files changed, 585 insertions(+), 0 deletions(-)
create mode 100644 drivers/net/pcinet.c
create mode 100644 drivers/net/pcinet2.c
diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c
index 9a312c3..5c110c9 100644
--- a/board/freescale/mpc8349emds/mpc8349emds.c
+++ b/board/freescale/mpc8349emds/mpc8349emds.c
@@ -165,7 +165,28 @@ int fixed_sdram(void)
int checkboard (void)
{
+ volatile immap_t *immr = (immap_t *)CFG_IMMR;
+ volatile u8 *bcsr = (u8 *)CFG_BCSR;
+ int host;
+ int in_pci_slot;
+
+#if 0
+ /* host or agent mode */
+ host = (immr->reset.rcwh & HRCWH_PCI_HOST) ? 1 : 0;
+#endif
+
+#if 1
+ /* in a pci slot or standalone */
+ in_pci_slot = (bcsr[10] & 0x80) ? 1 : 0;
+#endif
+
puts("Board: Freescale MPC8349EMDS\n");
+
+#if 0
+ printf("Mode: %s, %s\n",
+ host ? "Host" : "Agent",
+ in_pci_slot ? "in PCI slot" : "standalone");
+#endif
return 0;
}
diff --git a/cpu/mpc83xx/cpu.c b/cpu/mpc83xx/cpu.c
index 52e4476..5c68e2a 100644
--- a/cpu/mpc83xx/cpu.c
+++ b/cpu/mpc83xx/cpu.c
@@ -365,6 +365,7 @@ int dma_xfer(void *dest, u32 count, void *src)
*/
extern int tsec_initialize(bd_t * bis, int index, char *devname);
+extern int pcinet_initialize(bd_t *bis, int index, char *devname);
int cpu_eth_init(bd_t *bis)
{
@@ -374,6 +375,7 @@ int cpu_eth_init(bd_t *bis)
#if defined(CONFIG_TSEC2)
tsec_initialize(bis, 1, CONFIG_TSEC2_NAME);
#endif
+ pcinet_initialize(bis, 0, "pcinet");
return 0;
}
#endif
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index bcf31cb..3ce13c2 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -51,6 +51,7 @@ COBJS-$(CONFIG_NETCONSOLE) += netconsole.o
COBJS-$(CONFIG_DRIVER_NS7520_ETHERNET) += ns7520_eth.o
COBJS-$(CONFIG_NS8382X) += ns8382x.o
COBJS-$(CONFIG_DRIVER_NS9750_ETHERNET) += ns9750_eth.o
+COBJS-y += pcinet.o pcinet2.o
COBJS-$(CONFIG_PCNET) += pcnet.o
COBJS-$(CONFIG_PLB2800_ETHER) += plb2800_eth.o
COBJS-$(CONFIG_DRIVER_RTL8019) += rtl8019.o
diff --git a/drivers/net/pcinet.c b/drivers/net/pcinet.c
new file mode 100644
index 0000000..abfab48
--- /dev/null
+++ b/drivers/net/pcinet.c
@@ -0,0 +1,428 @@
+/*
+ * PCINet Virtual Ethernet over PCI driver
+ *
+ * This software may be used and distributed according to the
+ * terms of the GNU General Public License, Version 2, incorporated
+ * herein by reference.
+ *
+ * Copyright (c) 2008, Ira W. Snyder <iws(a)ovro.caltech.edu>
+ */
+
+#include <config.h>
+#include <common.h>
+#include <malloc.h>
+#include <net.h>
+#include <command.h>
+#include <asm/io.h>
+#include <asm/errno.h>
+#include <asm/atomic.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+const char longstring[] =
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaa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aaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+;
+
+extern volatile int pcinet_i1 = 1234;
+extern volatile int pcinet_i2;
+extern volatile int pcinet_i3;
+extern volatile int pcinet_i4;
+extern volatile int pcinet_i5;
+extern volatile int pcinet_i6;
+extern volatile int pcinet_i7;
+extern volatile int pcinet_i8;
+extern volatile int pcinet_i9;
+extern volatile int pcinet_i10;
+extern volatile int pcinet_i11;
+extern volatile int pcinet_i12;
+extern volatile int pcinet_i13;
+extern volatile int pcinet_i14;
+extern volatile int pcinet_i15;
+extern volatile int pcinet_i16;
+extern volatile int pcinet_i17;
+extern volatile int pcinet_i18;
+extern volatile int pcinet_i19;
+extern volatile int pcinet_i20;
+extern volatile int pcinet_i21;
+extern volatile int pcinet_i22;
+extern volatile int pcinet_i23;
+extern volatile int pcinet_i24;
+extern volatile int pcinet_i25;
+extern volatile int pcinet_i26;
+extern volatile int pcinet_i27;
+extern volatile int pcinet_i28;
+extern volatile int pcinet_i29;
+extern volatile int pcinet_i30;
+extern volatile int pcinet_i31;
+extern volatile int pcinet_i32;
+extern volatile int pcinet_i33;
+extern volatile int pcinet_i34;
+extern volatile int pcinet_i35;
+extern volatile int pcinet_i36;
+extern volatile int pcinet_i37;
+extern volatile int pcinet_i38;
+extern volatile int pcinet_i39;
+extern volatile int pcinet_i40;
+extern volatile int pcinet_i41;
+extern volatile int pcinet_i42;
+extern volatile int pcinet_i43;
+extern volatile int pcinet_i44;
+extern volatile int pcinet_i45;
+extern volatile int pcinet_i46;
+extern volatile int pcinet_i47;
+extern volatile int pcinet_i48;
+extern volatile int pcinet_i49;
+extern volatile int pcinet_i50;
+extern volatile int pcinet_i51;
+extern volatile int pcinet_i52;
+extern volatile int pcinet_i53;
+extern volatile int pcinet_i54;
+extern volatile int pcinet_i55;
+extern volatile int pcinet_i56;
+extern volatile int pcinet_i57;
+extern volatile int pcinet_i58;
+extern volatile int pcinet_i59;
+extern volatile int pcinet_i60;
+extern volatile int pcinet_i61;
+extern volatile int pcinet_i62;
+extern volatile int pcinet_i63;
+extern volatile int pcinet_i64;
+extern volatile int pcinet_i65;
+extern volatile int pcinet_i66;
+extern volatile int pcinet_i67;
+extern volatile int pcinet_i68;
+extern volatile int pcinet_i69;
+extern volatile int pcinet_i70;
+extern volatile int pcinet_i71;
+extern volatile int pcinet_i72;
+extern volatile int pcinet_i73;
+extern volatile int pcinet_i74;
+extern volatile int pcinet_i75;
+extern volatile int pcinet_i76;
+extern volatile int pcinet_i77;
+extern volatile int pcinet_i78;
+extern volatile int pcinet_i79;
+extern volatile int pcinet_i80;
+extern volatile int pcinet_i81;
+extern volatile int pcinet_i82;
+extern volatile int pcinet_i83;
+extern volatile int pcinet_i84;
+extern volatile int pcinet_i85;
+extern volatile int pcinet_i86;
+extern volatile int pcinet_i87;
+extern volatile int pcinet_i88;
+extern volatile int pcinet_i89;
+extern volatile int pcinet_i90;
+extern volatile int pcinet_i91;
+extern volatile int pcinet_i92;
+extern volatile int pcinet_i93;
+extern volatile int pcinet_i94;
+extern volatile int pcinet_i95;
+extern volatile int pcinet_i96;
+extern volatile int pcinet_i97;
+extern volatile int pcinet_i98;
+extern volatile int pcinet_i99;
+extern volatile int pcinet_i100;
+extern volatile int pcinet_i101;
+extern volatile int pcinet_i102;
+extern volatile int pcinet_i103;
+extern volatile int pcinet_i104;
+extern volatile int pcinet_i105;
+extern volatile int pcinet_i106;
+extern volatile int pcinet_i107;
+extern volatile int pcinet_i108;
+extern volatile int pcinet_i109;
+extern volatile int pcinet_i110;
+extern volatile int pcinet_i111;
+extern volatile int pcinet_i112;
+extern volatile int pcinet_i113;
+extern volatile int pcinet_i114;
+extern volatile int pcinet_i115;
+extern volatile int pcinet_i116;
+extern volatile int pcinet_i117;
+extern volatile int pcinet_i118;
+
+/* Called from net/eth.c to start the ethernet controller */
+int pcinet_initialize (bd_t *bis, int index, char *devname)
+{
+ volatile void *p = malloc(8192);
+ volatile void *p2 = memalign(4096, 4096);
+ volatile int i = pcinet_i1;
+ i = pcinet_i2;
+ i = pcinet_i3;
+ i = pcinet_i4;
+ i = pcinet_i5;
+ i = pcinet_i6;
+ i = pcinet_i7;
+ i = pcinet_i8;
+ i = pcinet_i9;
+ i = pcinet_i10;
+ i = pcinet_i11;
+ i = pcinet_i12;
+ i = pcinet_i13;
+ i = pcinet_i14;
+ i = pcinet_i15;
+ i = pcinet_i16;
+ i = pcinet_i17;
+ i = pcinet_i18;
+ i = pcinet_i19;
+ i = pcinet_i20;
+ i = pcinet_i21;
+ i = pcinet_i22;
+ i = pcinet_i23;
+ i = pcinet_i24;
+ i = pcinet_i25;
+ i = pcinet_i26;
+ i = pcinet_i27;
+ i = pcinet_i28;
+ i = pcinet_i29;
+ i = pcinet_i30;
+ i = pcinet_i31;
+ i = pcinet_i32;
+ i = pcinet_i33;
+ i = pcinet_i34;
+ i = pcinet_i35;
+ i = pcinet_i36;
+ i = pcinet_i37;
+ i = pcinet_i38;
+ i = pcinet_i39;
+ i = pcinet_i40;
+ i = pcinet_i41;
+ i = pcinet_i42;
+ i = pcinet_i43;
+ i = pcinet_i44;
+ i = pcinet_i45;
+ i = pcinet_i46;
+ i = pcinet_i47;
+ i = pcinet_i48;
+ i = pcinet_i49;
+ i = pcinet_i50;
+ i = pcinet_i51;
+ i = pcinet_i52;
+ i = pcinet_i53;
+ i = pcinet_i54;
+ i = pcinet_i55;
+ i = pcinet_i56;
+ i = pcinet_i57;
+ i = pcinet_i58;
+ i = pcinet_i59;
+ i = pcinet_i60;
+ i = pcinet_i61;
+ i = pcinet_i62;
+ i = pcinet_i63;
+ i = pcinet_i64;
+ i = pcinet_i65;
+ i = pcinet_i66;
+ i = pcinet_i67;
+ i = pcinet_i68;
+ i = pcinet_i69;
+ i = pcinet_i70;
+ i = pcinet_i71;
+ i = pcinet_i72;
+ i = pcinet_i73;
+ i = pcinet_i74;
+ i = pcinet_i75;
+ i = pcinet_i76;
+ i = pcinet_i77;
+ i = pcinet_i78;
+ i = pcinet_i79;
+ i = pcinet_i80;
+ i = pcinet_i81;
+ i = pcinet_i82;
+ i = pcinet_i83;
+ i = pcinet_i84;
+ i = pcinet_i85;
+ i = pcinet_i86;
+ i = pcinet_i87;
+ i = pcinet_i88;
+ i = pcinet_i89;
+ i = pcinet_i90;
+ i = pcinet_i91;
+ i = pcinet_i92;
+ i = pcinet_i93;
+ i = pcinet_i94;
+ i = pcinet_i95;
+ i = pcinet_i96;
+ i = pcinet_i97;
+ i = pcinet_i98;
+ i = pcinet_i99;
+ i = pcinet_i100;
+ i = pcinet_i101;
+ i = pcinet_i102;
+ i = pcinet_i103;
+ i = pcinet_i104;
+ i = pcinet_i105;
+ i = pcinet_i106;
+ i = pcinet_i107;
+ i = pcinet_i108;
+ i = pcinet_i109;
+ i = pcinet_i110;
+ i = pcinet_i111;
+ i = pcinet_i112;
+ i = pcinet_i113;
+ i = pcinet_i114;
+ i = pcinet_i115;
+ i = pcinet_i116;
+ i = pcinet_i117;
+ i = pcinet_i118;
+
+ printf("PCINET INIT: Alloc @ 0x%p\n", p);
+
+ for (i=0; i<10000000; ++i)
+ if (i % 100000 == 0)
+ printf("i=%d\n", i);
+
+ return 0;
+}
+
+/* vim: set ts=8 sts=8 sw=8 noet tw=92: */
diff --git a/drivers/net/pcinet2.c b/drivers/net/pcinet2.c
new file mode 100644
index 0000000..cfdfd33
--- /dev/null
+++ b/drivers/net/pcinet2.c
@@ -0,0 +1,133 @@
+/*
+ * ONE-LINE DESCRIPTION
+ *
+ * Copyright (c) 2008 Ira W. Snyder <iws(a)ovro.caltech.edu>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+/* if you add a non-zero initializer here, the space moves from the
+ * .bss to the .data section */
+volatile int pcinet_i1;
+volatile int pcinet_i2;
+volatile int pcinet_i3;
+volatile int pcinet_i4;
+volatile int pcinet_i5;
+volatile int pcinet_i6;
+volatile int pcinet_i7;
+volatile int pcinet_i8;
+volatile int pcinet_i9;
+volatile int pcinet_i10;
+volatile int pcinet_i11;
+volatile int pcinet_i12;
+volatile int pcinet_i13;
+volatile int pcinet_i14;
+volatile int pcinet_i15;
+volatile int pcinet_i16;
+volatile int pcinet_i17;
+volatile int pcinet_i18;
+volatile int pcinet_i19;
+volatile int pcinet_i20;
+volatile int pcinet_i21;
+volatile int pcinet_i22;
+volatile int pcinet_i23;
+volatile int pcinet_i24;
+volatile int pcinet_i25;
+volatile int pcinet_i26;
+volatile int pcinet_i27;
+volatile int pcinet_i28;
+volatile int pcinet_i29;
+volatile int pcinet_i30;
+volatile int pcinet_i31;
+volatile int pcinet_i32;
+volatile int pcinet_i33;
+volatile int pcinet_i34;
+volatile int pcinet_i35;
+volatile int pcinet_i36;
+volatile int pcinet_i37;
+volatile int pcinet_i38;
+volatile int pcinet_i39;
+volatile int pcinet_i40;
+volatile int pcinet_i41;
+volatile int pcinet_i42;
+volatile int pcinet_i43;
+volatile int pcinet_i44;
+volatile int pcinet_i45;
+volatile int pcinet_i46;
+volatile int pcinet_i47;
+volatile int pcinet_i48;
+volatile int pcinet_i49;
+volatile int pcinet_i50;
+volatile int pcinet_i51;
+volatile int pcinet_i52;
+volatile int pcinet_i53;
+volatile int pcinet_i54;
+volatile int pcinet_i55;
+volatile int pcinet_i56;
+volatile int pcinet_i57;
+volatile int pcinet_i58;
+volatile int pcinet_i59;
+volatile int pcinet_i60;
+volatile int pcinet_i61;
+volatile int pcinet_i62;
+volatile int pcinet_i63;
+volatile int pcinet_i64;
+volatile int pcinet_i65;
+volatile int pcinet_i66;
+volatile int pcinet_i67;
+volatile int pcinet_i68;
+volatile int pcinet_i69;
+volatile int pcinet_i70;
+volatile int pcinet_i71;
+volatile int pcinet_i72;
+volatile int pcinet_i73;
+volatile int pcinet_i74;
+volatile int pcinet_i75;
+volatile int pcinet_i76;
+volatile int pcinet_i77;
+volatile int pcinet_i78;
+volatile int pcinet_i79;
+volatile int pcinet_i80;
+volatile int pcinet_i81;
+volatile int pcinet_i82;
+volatile int pcinet_i83;
+volatile int pcinet_i84;
+volatile int pcinet_i85;
+volatile int pcinet_i86;
+volatile int pcinet_i87;
+volatile int pcinet_i88;
+volatile int pcinet_i89;
+volatile int pcinet_i90;
+volatile int pcinet_i91;
+volatile int pcinet_i92;
+volatile int pcinet_i93;
+volatile int pcinet_i94;
+volatile int pcinet_i95;
+volatile int pcinet_i96;
+volatile int pcinet_i97;
+volatile int pcinet_i98;
+volatile int pcinet_i99;
+volatile int pcinet_i100;
+volatile int pcinet_i101;
+volatile int pcinet_i102;
+volatile int pcinet_i103;
+volatile int pcinet_i104;
+volatile int pcinet_i105;
+volatile int pcinet_i106;
+volatile int pcinet_i107;
+volatile int pcinet_i108;
+volatile int pcinet_i109;
+volatile int pcinet_i110;
+volatile int pcinet_i111;
+volatile int pcinet_i112;
+volatile int pcinet_i113;
+volatile int pcinet_i114;
+volatile int pcinet_i115;
+volatile int pcinet_i116;
+volatile int pcinet_i117;
+volatile int pcinet_i118;
+
+
+/* vim: set ts=8 sts=8 sw=8 noet tw=92: */
--
1.5.4.3
8
30