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

19 Aug '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>
---
V1 dropped setting of the decrementer_count, add that back in.
- k
cpu/mpc85xx/interrupts.c | 109 +++++-----------------------------------------
1 files changed, 12 insertions(+), 97 deletions(-)
diff --git a/cpu/mpc85xx/interrupts.c b/cpu/mpc85xx/interrupts.c
index 4fe1fac..06d4d8b 100644
--- a/cpu/mpc85xx/interrupts.c
+++ b/cpu/mpc85xx/interrupts.c
@@ -31,64 +31,20 @@
#include <watchdog.h>
#include <command.h>
#include <asm/processor.h>
-#include <ppc_asm.tmpl>
-unsigned decrementer_count; /* count value for 1e6/HZ microseconds */
-
-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));
- asm volatile("isync");
-}
-
-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));
-}
-
-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);
-}
-
-int interrupt_init (void)
+int interrupt_init_cpu(unsigned long *decrementer_count)
{
volatile ccsr_pic_t *pic = (void *)(CFG_MPC85xx_PIC_ADDR);
pic->gcr = MPC85xx_PICGCR_RST;
- while (pic->gcr & MPC85xx_PICGCR_RST);
+ while (pic->gcr & MPC85xx_PICGCR_RST)
+ ;
pic->gcr = MPC85xx_PICGCR_M;
- decrementer_count = get_tbclk() / CFG_HZ;
+
+ *decrementer_count = get_tbclk() / CFG_HZ;
+
+ /* PIE is same as DIE, dec interrupt enable */
mtspr(SPRN_TCR, TCR_PIE);
- set_dec (decrementer_count);
- set_msr (get_msr () | MSR_EE);
#ifdef CONFIG_INTERRUPTS
pic->iivpr1 = 0x810001; /* 50220 enable ecm interrupts */
@@ -123,9 +79,7 @@ int interrupt_init (void)
return (0);
}
-/*
- * Install and free a interrupt handler. Not implemented yet.
- */
+/* Install and free a interrupt handler. Not implemented yet. */
void
irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
@@ -139,55 +93,16 @@ irq_free_handler(int vec)
return;
}
-/****************************************************************************/
-
-
-volatile ulong timestamp = 0;
-
-/*
- * timer_interrupt - gets called when the decrementer overflows,
- * with interrupts disabled.
- * Trivial implementation - no need to be really accurate.
- */
-void timer_interrupt(struct pt_regs *regs)
+void timer_interrupt_cpu(struct pt_regs *regs)
{
- timestamp++;
- set_dec (decrementer_count);
+ /* PIS is same as DIS, dec interrupt status */
mtspr(SPRN_TSR, TSR_PIS);
-#if defined(CONFIG_WATCHDOG)
- if ((timestamp % 1000) == 0)
- reset_85xx_watchdog();
-#endif /* CONFIG_WATCHDOG */
-}
-
-void reset_timer (void)
-{
- timestamp = 0;
-}
-
-ulong get_timer (ulong base)
-{
- return (timestamp - base);
-}
-
-void set_timer (ulong t)
-{
- timestamp = t;
}
#if defined(CONFIG_CMD_IRQ)
-
-/*******************************************************************************
- *
- * irqinfo - print information about PCI devices,not implemented.
- *
- */
-int
-do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+/* irqinfo - print information about PCI devices,not implemented. */
+int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- printf ("\nInterrupt-unsupported:\n");
-
return 0;
}
-
#endif
--
1.5.5.1
1
0

19 Aug '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/mpc85xx/interrupts.c | 107 ++++-----------------------------------------
1 files changed, 10 insertions(+), 97 deletions(-)
diff --git a/cpu/mpc85xx/interrupts.c b/cpu/mpc85xx/interrupts.c
index 4fe1fac..a407c05 100644
--- a/cpu/mpc85xx/interrupts.c
+++ b/cpu/mpc85xx/interrupts.c
@@ -31,64 +31,18 @@
#include <watchdog.h>
#include <command.h>
#include <asm/processor.h>
-#include <ppc_asm.tmpl>
-unsigned decrementer_count; /* count value for 1e6/HZ microseconds */
-
-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));
- asm volatile("isync");
-}
-
-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));
-}
-
-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);
-}
-
-int interrupt_init (void)
+int interrupt_init_cpu(unsigned long *decrementer_count)
{
volatile ccsr_pic_t *pic = (void *)(CFG_MPC85xx_PIC_ADDR);
pic->gcr = MPC85xx_PICGCR_RST;
- while (pic->gcr & MPC85xx_PICGCR_RST);
+ while (pic->gcr & MPC85xx_PICGCR_RST)
+ ;
pic->gcr = MPC85xx_PICGCR_M;
- decrementer_count = get_tbclk() / CFG_HZ;
+
+ /* PIE is same as DIE, dec interrupt enable */
mtspr(SPRN_TCR, TCR_PIE);
- set_dec (decrementer_count);
- set_msr (get_msr () | MSR_EE);
#ifdef CONFIG_INTERRUPTS
pic->iivpr1 = 0x810001; /* 50220 enable ecm interrupts */
@@ -123,9 +77,7 @@ int interrupt_init (void)
return (0);
}
-/*
- * Install and free a interrupt handler. Not implemented yet.
- */
+/* Install and free a interrupt handler. Not implemented yet. */
void
irq_install_handler(int vec, interrupt_handler_t *handler, void *arg)
@@ -139,55 +91,16 @@ irq_free_handler(int vec)
return;
}
-/****************************************************************************/
-
-
-volatile ulong timestamp = 0;
-
-/*
- * timer_interrupt - gets called when the decrementer overflows,
- * with interrupts disabled.
- * Trivial implementation - no need to be really accurate.
- */
-void timer_interrupt(struct pt_regs *regs)
+void timer_interrupt_cpu(struct pt_regs *regs)
{
- timestamp++;
- set_dec (decrementer_count);
+ /* PIS is same as DIS, dec interrupt status */
mtspr(SPRN_TSR, TSR_PIS);
-#if defined(CONFIG_WATCHDOG)
- if ((timestamp % 1000) == 0)
- reset_85xx_watchdog();
-#endif /* CONFIG_WATCHDOG */
-}
-
-void reset_timer (void)
-{
- timestamp = 0;
-}
-
-ulong get_timer (ulong base)
-{
- return (timestamp - base);
-}
-
-void set_timer (ulong t)
-{
- timestamp = t;
}
#if defined(CONFIG_CMD_IRQ)
-
-/*******************************************************************************
- *
- * irqinfo - print information about PCI devices,not implemented.
- *
- */
-int
-do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+/* irqinfo - print information about PCI devices,not implemented. */
+int do_irqinfo(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
- printf ("\nInterrupt-unsupported:\n");
-
return 0;
}
-
#endif
--
1.5.5.1
1
0
From: TsiChung Liew <Tsi-Chung.Liew(a)freescale.com>
The existing I2C freqency dividers for FDR does not apply
to ColdFire platforms; thus, a seperate table is added
based on MCF5xxx Reference Manual
Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini(a)idf-hit.com>
Signed-off-by: TsiChung Liew <Tsi-Chung.Liew(a)freescale.com>
---
drivers/i2c/fsl_i2c.c | 34 +++++++++++++++++++++++++++++++++-
1 files changed, 33 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index 3f78e2f..bbdfc33 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -77,12 +77,20 @@ static const struct fsl_i2c *i2c_dev[2] = {
* For this table, the values are based on a value of 1 for the DFSR
* register. See the application note AN2919 "Determining the I2C Frequency
* Divider Ratio for SCL"
+ *
+ * ColdFire I2C frequency dividers for FDR values are different from
+ * PowerPC. The protocol to use the I2C module is still the same.
+ * A different table is defined and are based on MCF5xxx user manual.
+ *
*/
static const struct {
unsigned short divider;
+#ifdef __PPC__
u8 dfsr;
+#endif
u8 fdr;
} fsl_i2c_speed_map[] = {
+#ifdef __PPC__
{160, 1, 32}, {192, 1, 33}, {224, 1, 34}, {256, 1, 35},
{288, 1, 0}, {320, 1, 1}, {352, 6, 1}, {384, 1, 2}, {416, 6, 2},
{448, 1, 38}, {480, 1, 3}, {512, 1, 39}, {544, 11, 3}, {576, 1, 4},
@@ -99,6 +107,25 @@ static const struct {
{20480, 1, 25}, {24576, 1, 26}, {28672, 1, 62}, {30720, 1, 27},
{32768, 1, 63}, {36864, 1, 28}, {40960, 1, 29}, {49152, 1, 30},
{61440, 1, 31}, {-1, 1, 31}
+#elif defined(__M68K__)
+ {20, 32}, {22, 33}, {24, 34}, {26, 35},
+ {28, 0}, {28, 36}, {30, 1}, {32, 37},
+ {34, 2}, {36, 38}, {40, 3}, {40, 39},
+ {44, 4}, {48, 5}, {48, 40}, {56, 6},
+ {56, 41}, {64, 42}, {68, 7}, {72, 43},
+ {80, 8}, {80, 44}, {88, 9}, {96, 41},
+ {104, 10}, {112, 42}, {128, 11}, {128, 43},
+ {144, 12}, {160, 13}, {160, 48}, {192, 14},
+ {192, 49}, {224, 50}, {240, 15}, {256, 51},
+ {288, 16}, {320, 17}, {320, 52}, {384, 18},
+ {384, 53}, {448, 54}, {480, 19}, {512, 55},
+ {576, 20}, {640, 21}, {640, 56}, {768, 22},
+ {768, 57}, {960, 23}, {896, 58}, {1024, 59},
+ {1152, 24}, {1280, 25}, {1280, 60}, {1536, 26},
+ {1536, 61}, {1792, 62}, {1920, 27}, {2048, 63},
+ {2304, 28}, {2560, 29}, {3072, 30}, {3840, 31},
+ {-1, 31}
+#endif
};
/**
@@ -127,12 +154,17 @@ static unsigned int set_i2c_bus_speed(const struct fsl_i2c *dev,
for (i = 0; i < ARRAY_SIZE(fsl_i2c_speed_map); i++)
if (fsl_i2c_speed_map[i].divider >= divider) {
- u8 fdr, dfsr;
+ u8 fdr;
+#ifdef __PPC__
+ u8 dfsr;
dfsr = fsl_i2c_speed_map[i].dfsr;
+#endif
fdr = fsl_i2c_speed_map[i].fdr;
speed = i2c_clk / fsl_i2c_speed_map[i].divider;
writeb(fdr, &dev->fdr); /* set bus speed */
+#ifdef __PPC__
writeb(dfsr, &dev->dfsrr); /* set default filter */
+#endif
break;
}
--
1.5.6.3
3
2

[U-Boot] [PATCH v6] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t
by Kumar Gala 19 Aug '08
by Kumar Gala 19 Aug '08
19 Aug '08
Move to using the environment variables 'ethaddr', 'eth1addr', etc..
instead of bd->bi_enetaddr, bi_enet1addr, etc.
This makes the code a bit more flexible to the number of ethernet
interfaces.
Signed-off-by: Kumar Gala <galak(a)kernel.crashing.org>
---
Use Wolfgang's while loop.
- k
common/fdt_support.c | 67 +++++++++++++++++++------------------------------
cpu/74xx_7xx/cpu.c | 2 +-
cpu/mpc512x/cpu.c | 2 +-
cpu/mpc8260/cpu.c | 2 +-
cpu/mpc83xx/fdt.c | 2 +-
cpu/mpc85xx/fdt.c | 2 +-
cpu/mpc86xx/fdt.c | 2 +-
cpu/mpc8xx/fdt.c | 2 +-
cpu/ppc4xx/fdt.c | 2 +-
include/fdt_support.h | 2 +-
10 files changed, 35 insertions(+), 50 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..afed43a 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -368,55 +368,40 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return 0;
}
-#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
- defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
-
-void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+void fdt_fixup_ethernet(void *fdt)
{
- int node;
+ int node, i, j;
+ char enet[12], *tmp, *end;
+ char mac[10] = "ethaddr";
const char *path;
+ unsigned char mac_addr[6];
node = fdt_path_offset(fdt, "/aliases");
- if (node >= 0) {
-#if defined(CONFIG_HAS_ETH0)
- path = fdt_getprop(fdt, node, "ethernet0", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enetaddr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enetaddr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH1)
- path = fdt_getprop(fdt, node, "ethernet1", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet1addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet1addr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH2)
- path = fdt_getprop(fdt, node, "ethernet2", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet2addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet2addr, 6, 1);
+ if (node < 0)
+ return;
+
+ i = 0;
+ while ((tmp = getenv(mac)) != NULL) {
+ sprintf(enet, "ethernet%d", i);
+ path = fdt_getprop(fdt, node, enet, NULL);
+ if (!path) {
+ debug("No alias for %s\n", enet);
+ continue;
}
-#endif
-#if defined(CONFIG_HAS_ETH3)
- path = fdt_getprop(fdt, node, "ethernet3", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet3addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet3addr, 6, 1);
+
+ for (j = 0; j < 6; j++) {
+ mac_addr[j] = tmp ? simple_strtoul(tmp, &end, 16) : 0;
+ if (tmp)
+ tmp = (*end) ? end+1 : end;
}
-#endif
+
+ do_fixup_by_path(fdt, path, "mac-address", &mac_addr, 6, 0);
+ do_fixup_by_path(fdt, path, "local-mac-address",
+ &mac_addr, 6, 1);
+
+ sprintf(mac, "eth%daddr", ++i);
}
}
-#endif
#ifdef CONFIG_HAS_FSL_DR_USB
void fdt_fixup_dr_usb(void *blob, bd_t *bd)
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c
index ea43c9a..c007abc 100644
--- a/cpu/74xx_7xx/cpu.c
+++ b/cpu/74xx_7xx/cpu.c
@@ -314,7 +314,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
}
#endif
/* ------------------------------------------------------------------------- */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 703e188..1f39ac4 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -191,7 +191,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#endif
ft_clock_setup(blob, bd);
#ifdef CONFIG_HAS_ETH0
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
}
#endif
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 4d5d141..efb8ed6 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -307,7 +307,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
diff --git a/cpu/mpc83xx/fdt.c b/cpu/mpc83xx/fdt.c
index fda85c1..39bd9dc 100644
--- a/cpu/mpc83xx/fdt.c
+++ b/cpu/mpc83xx/fdt.c
@@ -53,7 +53,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c
index c159934..bc1550d 100644
--- a/cpu/mpc85xx/fdt.c
+++ b/cpu/mpc85xx/fdt.c
@@ -212,7 +212,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc86xx/fdt.c b/cpu/mpc86xx/fdt.c
index 80a5c78..12d9052 100644
--- a/cpu/mpc86xx/fdt.c
+++ b/cpu/mpc86xx/fdt.c
@@ -25,7 +25,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
|| defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
#ifdef CFG_NS16550
diff --git a/cpu/mpc8xx/fdt.c b/cpu/mpc8xx/fdt.c
index 567094a..7130983 100644
--- a/cpu/mpc8xx/fdt.c
+++ b/cpu/mpc8xx/fdt.c
@@ -40,7 +40,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
gd->brg_clk, 1);
/* Fixup ethernet MAC addresses */
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index 0323dc5..a97484f 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -130,7 +130,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
* Fixup all ethernet nodes
* Note: aliases in the dts are required for this
*/
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
/*
* Fixup all available PCIe nodes by setting the device_type property
diff --git a/include/fdt_support.h b/include/fdt_support.h
index a7c6326..f2f2cd5 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -45,7 +45,7 @@ void do_fixup_by_compat(void *fdt, const char *compat,
void do_fixup_by_compat_u32(void *fdt, const char *compat,
const char *prop, u32 val, int create);
int fdt_fixup_memory(void *blob, u64 start, u64 size);
-void fdt_fixup_ethernet(void *fdt, bd_t *bd);
+void fdt_fixup_ethernet(void *fdt);
int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
const void *val, int len, int create);
void fdt_fixup_qe_firmware(void *fdt);
--
1.5.5.1
1
0

[U-Boot] [PATCH v4] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t
by Kumar Gala 19 Aug '08
by Kumar Gala 19 Aug '08
19 Aug '08
Move to using the environment variables 'ethaddr', 'eth1addr', etc..
instead of bd->bi_enetaddr, bi_enet1addr, etc.
This makes the code a bit more flexible to the number of ethernet
interfaces.
Signed-off-by: Kumar Gala <galak(a)kernel.crashing.org>
---
Iterate over the aliases since its simplier than inventing a wheel to
iterate over the environment. This removes the hard coded limit.
- k
common/fdt_support.c | 85 +++++++++++++++++++++++++------------------------
cpu/74xx_7xx/cpu.c | 2 +-
cpu/mpc512x/cpu.c | 2 +-
cpu/mpc8260/cpu.c | 2 +-
cpu/mpc83xx/fdt.c | 2 +-
cpu/mpc85xx/fdt.c | 2 +-
cpu/mpc86xx/fdt.c | 2 +-
cpu/mpc8xx/fdt.c | 2 +-
cpu/ppc4xx/fdt.c | 2 +-
include/fdt_support.h | 2 +-
10 files changed, 52 insertions(+), 51 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..eeca242 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -368,55 +368,56 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return 0;
}
-#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
- defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
-
-void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+static void fdt_fixup_one_mac(void *fdt, int aliasoffset, const char *alias, int idx)
{
- int node;
+ char mac[10], *tmp, *end;
+ unsigned char mac_addr[6];
const char *path;
+ int i;
+
+ sprintf(mac, idx ? "eth%daddr" : "ethaddr", idx);
+ tmp = getenv(mac);
+
+ if (!tmp) {
+ debug("No environment variable for %s\n", mac);
+ return;
+ }
+
+ path = fdt_getprop(fdt, aliasoffset, alias, NULL);
- node = fdt_path_offset(fdt, "/aliases");
+ for (i = 0; i < 6; i++) {
+ mac_addr[i] = tmp ? simple_strtoul(tmp, &end, 16) : 0;
+ if (tmp)
+ tmp = (*end) ? end+1 : end;
+ }
+
+ do_fixup_by_path(fdt, path, "mac-address", &mac_addr, 6, 0);
+ do_fixup_by_path(fdt, path, "local-mac-address", &mac_addr, 6, 1);
+}
+
+void fdt_fixup_ethernet(void *fdt)
+{
+ int node, next;
+
+ next = node = fdt_path_offset(fdt, "/aliases");
if (node >= 0) {
-#if defined(CONFIG_HAS_ETH0)
- path = fdt_getprop(fdt, node, "ethernet0", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enetaddr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enetaddr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH1)
- path = fdt_getprop(fdt, node, "ethernet1", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet1addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet1addr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH2)
- path = fdt_getprop(fdt, node, "ethernet2", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet2addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet2addr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH3)
- path = fdt_getprop(fdt, node, "ethernet3", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet3addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet3addr, 6, 1);
+ while (FDT_END_NODE != fdt_next_tag(fdt, next, &next)) {
+ const struct fdt_property *prop;
+ const char *name;
+
+ prop = fdt_offset_ptr(fdt, next, sizeof(*prop));
+ name = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+
+ if (0 == memcmp("ethernet", name, 8)) {
+ unsigned int idx;
+
+ idx = simple_strtoul(name + 8, NULL, 10);
+
+ fdt_fixup_one_mac(fdt, node, name, idx);
+ }
}
-#endif
}
}
-#endif
#ifdef CONFIG_HAS_FSL_DR_USB
void fdt_fixup_dr_usb(void *blob, bd_t *bd)
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c
index ea43c9a..c007abc 100644
--- a/cpu/74xx_7xx/cpu.c
+++ b/cpu/74xx_7xx/cpu.c
@@ -314,7 +314,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
}
#endif
/* ------------------------------------------------------------------------- */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 703e188..1f39ac4 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -191,7 +191,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#endif
ft_clock_setup(blob, bd);
#ifdef CONFIG_HAS_ETH0
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
}
#endif
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 4d5d141..efb8ed6 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -307,7 +307,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
diff --git a/cpu/mpc83xx/fdt.c b/cpu/mpc83xx/fdt.c
index fda85c1..39bd9dc 100644
--- a/cpu/mpc83xx/fdt.c
+++ b/cpu/mpc83xx/fdt.c
@@ -53,7 +53,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c
index c159934..bc1550d 100644
--- a/cpu/mpc85xx/fdt.c
+++ b/cpu/mpc85xx/fdt.c
@@ -212,7 +212,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc86xx/fdt.c b/cpu/mpc86xx/fdt.c
index 80a5c78..12d9052 100644
--- a/cpu/mpc86xx/fdt.c
+++ b/cpu/mpc86xx/fdt.c
@@ -25,7 +25,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
|| defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
#ifdef CFG_NS16550
diff --git a/cpu/mpc8xx/fdt.c b/cpu/mpc8xx/fdt.c
index 567094a..7130983 100644
--- a/cpu/mpc8xx/fdt.c
+++ b/cpu/mpc8xx/fdt.c
@@ -40,7 +40,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
gd->brg_clk, 1);
/* Fixup ethernet MAC addresses */
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index 0323dc5..a97484f 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -130,7 +130,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
* Fixup all ethernet nodes
* Note: aliases in the dts are required for this
*/
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
/*
* Fixup all available PCIe nodes by setting the device_type property
diff --git a/include/fdt_support.h b/include/fdt_support.h
index a7c6326..f2f2cd5 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -45,7 +45,7 @@ void do_fixup_by_compat(void *fdt, const char *compat,
void do_fixup_by_compat_u32(void *fdt, const char *compat,
const char *prop, u32 val, int create);
int fdt_fixup_memory(void *blob, u64 start, u64 size);
-void fdt_fixup_ethernet(void *fdt, bd_t *bd);
+void fdt_fixup_ethernet(void *fdt);
int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
const void *val, int len, int create);
void fdt_fixup_qe_firmware(void *fdt);
--
1.5.5.1
2
1

[U-Boot] [PATCH v5] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t
by Kumar Gala 19 Aug '08
by Kumar Gala 19 Aug '08
19 Aug '08
Move to using the environment variables 'ethaddr', 'eth1addr', etc..
instead of bd->bi_enetaddr, bi_enet1addr, etc.
This makes the code a bit more flexible to the number of ethernet
interfaces.
Signed-off-by: Kumar Gala <galak(a)kernel.crashing.org>
---
Just iterate over eth*addr until we dont find one. I think this isn't
as robust os iterating of the aliases, but oh well.
- k
common/fdt_support.c | 70 +++++++++++++++++++++----------------------------
cpu/74xx_7xx/cpu.c | 2 +-
cpu/mpc512x/cpu.c | 2 +-
cpu/mpc8260/cpu.c | 2 +-
cpu/mpc83xx/fdt.c | 2 +-
cpu/mpc85xx/fdt.c | 2 +-
cpu/mpc86xx/fdt.c | 2 +-
cpu/mpc8xx/fdt.c | 2 +-
cpu/ppc4xx/fdt.c | 2 +-
include/fdt_support.h | 2 +-
10 files changed, 39 insertions(+), 49 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..dce404e 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -368,55 +368,45 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return 0;
}
-#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
- defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
-
-void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+void fdt_fixup_ethernet(void *fdt)
{
- int node;
+ int node, i, j;
+ char enet[12], mac[10], *tmp, *end;
const char *path;
+ unsigned char mac_addr[6];
node = fdt_path_offset(fdt, "/aliases");
- if (node >= 0) {
-#if defined(CONFIG_HAS_ETH0)
- path = fdt_getprop(fdt, node, "ethernet0", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enetaddr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enetaddr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH1)
- path = fdt_getprop(fdt, node, "ethernet1", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet1addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet1addr, 6, 1);
+ if (node < 0)
+ return;
+
+ i = 0;
+ while (1) {
+ sprintf(mac, i ? "eth%daddr" : "ethaddr", i);
+ tmp = getenv(mac);
+ if (!tmp) {
+ debug("No environment variable for %s\n", mac);
+ break;
}
-#endif
-#if defined(CONFIG_HAS_ETH2)
- path = fdt_getprop(fdt, node, "ethernet2", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet2addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet2addr, 6, 1);
+
+ sprintf(enet, "ethernet%d", i);
+ path = fdt_getprop(fdt, node, enet, NULL);
+ if (!path) {
+ debug("No alias for %s\n", enet);
+ continue;
}
-#endif
-#if defined(CONFIG_HAS_ETH3)
- path = fdt_getprop(fdt, node, "ethernet3", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet3addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet3addr, 6, 1);
+
+ for (j = 0; j < 6; j++) {
+ mac_addr[j] = tmp ? simple_strtoul(tmp, &end, 16) : 0;
+ if (tmp)
+ tmp = (*end) ? end+1 : end;
}
-#endif
+
+ do_fixup_by_path(fdt, path, "mac-address", &mac_addr, 6, 0);
+ do_fixup_by_path(fdt, path, "local-mac-address",
+ &mac_addr, 6, 1);
+ i++;
}
}
-#endif
#ifdef CONFIG_HAS_FSL_DR_USB
void fdt_fixup_dr_usb(void *blob, bd_t *bd)
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c
index ea43c9a..c007abc 100644
--- a/cpu/74xx_7xx/cpu.c
+++ b/cpu/74xx_7xx/cpu.c
@@ -314,7 +314,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
}
#endif
/* ------------------------------------------------------------------------- */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 703e188..1f39ac4 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -191,7 +191,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#endif
ft_clock_setup(blob, bd);
#ifdef CONFIG_HAS_ETH0
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
}
#endif
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 4d5d141..efb8ed6 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -307,7 +307,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
diff --git a/cpu/mpc83xx/fdt.c b/cpu/mpc83xx/fdt.c
index fda85c1..39bd9dc 100644
--- a/cpu/mpc83xx/fdt.c
+++ b/cpu/mpc83xx/fdt.c
@@ -53,7 +53,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c
index c159934..bc1550d 100644
--- a/cpu/mpc85xx/fdt.c
+++ b/cpu/mpc85xx/fdt.c
@@ -212,7 +212,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc86xx/fdt.c b/cpu/mpc86xx/fdt.c
index 80a5c78..12d9052 100644
--- a/cpu/mpc86xx/fdt.c
+++ b/cpu/mpc86xx/fdt.c
@@ -25,7 +25,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
|| defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
#ifdef CFG_NS16550
diff --git a/cpu/mpc8xx/fdt.c b/cpu/mpc8xx/fdt.c
index 567094a..7130983 100644
--- a/cpu/mpc8xx/fdt.c
+++ b/cpu/mpc8xx/fdt.c
@@ -40,7 +40,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
gd->brg_clk, 1);
/* Fixup ethernet MAC addresses */
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index 0323dc5..a97484f 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -130,7 +130,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
* Fixup all ethernet nodes
* Note: aliases in the dts are required for this
*/
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
/*
* Fixup all available PCIe nodes by setting the device_type property
diff --git a/include/fdt_support.h b/include/fdt_support.h
index a7c6326..f2f2cd5 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -45,7 +45,7 @@ void do_fixup_by_compat(void *fdt, const char *compat,
void do_fixup_by_compat_u32(void *fdt, const char *compat,
const char *prop, u32 val, int create);
int fdt_fixup_memory(void *blob, u64 start, u64 size);
-void fdt_fixup_ethernet(void *fdt, bd_t *bd);
+void fdt_fixup_ethernet(void *fdt);
int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
const void *val, int len, int create);
void fdt_fixup_qe_firmware(void *fdt);
--
1.5.5.1
1
0

[U-Boot] [PATCH v3] fdt: rework fdt_fixup_ethernet() to use env instead of bd_t
by Kumar Gala 19 Aug '08
by Kumar Gala 19 Aug '08
19 Aug '08
Move to using the environment variables 'ethaddr', 'eth1addr', etc..
instead of bd->bi_enetaddr, bi_enet1addr, etc.
This makes the code a bit more flexible to the number of ethernet
interfaces.
Signed-off-by: Kumar Gala <galak(a)kernel.crashing.org>
---
We walk through the env now searching for 'eth*addr' and parse a match
to deal with the fixup.
- k
common/cmd_nvedit.c | 17 +++++++
common/fdt_support.c | 123 ++++++++++++++++++++++++++++++++----------------
cpu/74xx_7xx/cpu.c | 2 +-
cpu/mpc512x/cpu.c | 2 +-
cpu/mpc8260/cpu.c | 2 +-
cpu/mpc83xx/fdt.c | 2 +-
cpu/mpc85xx/fdt.c | 2 +-
cpu/mpc86xx/fdt.c | 2 +-
cpu/mpc8xx/fdt.c | 2 +-
cpu/ppc4xx/fdt.c | 2 +-
include/common.h | 2 +
include/fdt_support.h | 2 +-
12 files changed, 110 insertions(+), 50 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 7089706..9894cf5 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -576,6 +576,23 @@ int envmatch (uchar *s1, int i2)
return(-1);
}
+/* compare memory to a portion of the environment, similiar
+ * to memcmp, except s2 is provided by an index into the environment
+ */
+int envcmp(const void *s1, int i2, size_t count)
+{
+ const unsigned char *su1;
+ unsigned char c;
+ int res = 0, j;
+
+ for(su1 = s1, j = i2; 0 < count; ++su1, ++j, count--) {
+ c = env_get_char(j);
+ if ((res = *su1 - c) != 0)
+ break;
+ }
+
+ return res;
+}
/**************************************************/
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 93b144e..527e747 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -368,55 +368,96 @@ int fdt_fixup_memory(void *blob, u64 start, u64 size)
return 0;
}
-#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
- defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
-
-void fdt_fixup_ethernet(void *fdt, bd_t *bd)
+static void fdt_fixup_one_mac(void *fdt, int aliasnode,
+ int ethidx, void *mac_addr)
{
- int node;
const char *path;
+ char enet[12];
+
+ sprintf(enet, "ethernet%d", ethidx);
+
+ path = fdt_getprop(fdt, aliasnode, enet, NULL);
+ if (!path) {
+ debug("No alias for %s\n", enet);
+ return;
+ }
+
+ do_fixup_by_path(fdt, path, "mac-address", mac_addr, 6, 0);
+ do_fixup_by_path(fdt, path, "local-mac-address", mac_addr, 6, 1);
+}
+
+void fdt_fixup_ethernet(void *fdt)
+{
+ int i, j, k, nxt, addr, idx, val, node;
+ unsigned char c, mac_addr[6];
node = fdt_path_offset(fdt, "/aliases");
- if (node >= 0) {
-#if defined(CONFIG_HAS_ETH0)
- path = fdt_getprop(fdt, node, "ethernet0", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enetaddr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enetaddr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH1)
- path = fdt_getprop(fdt, node, "ethernet1", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet1addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet1addr, 6, 1);
- }
-#endif
-#if defined(CONFIG_HAS_ETH2)
- path = fdt_getprop(fdt, node, "ethernet2", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet2addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet2addr, 6, 1);
+ if (node < 0)
+ return;
+
+ /* walk the env looking for eth[.*]addr */
+ for (i=0; env_get_char(i) != '\0'; i=nxt+1) {
+ for (nxt=i; env_get_char(nxt) != '\0'; ++nxt)
+ ;
+
+ /* if the pair isn't long enough, continue */
+ if ((nxt - i) < 19)
+ continue;
+
+ /* if it doesn't start with eth, continue */
+ if (0 != envcmp("eth", i, 3))
+ continue;
+
+ /* search for the first 'a', in addr= */
+ addr = i + 3;
+ for (; addr < nxt; ++addr)
+ if (env_get_char(addr) == 'a')
+ break;
+
+ /* if its not 'addr=', continue */
+ if (0 != envcmp("addr=", addr, 5))
+ continue;
+
+ /* if we dont have enough chars for the mac addr, continue */
+ if ((nxt - addr) < 16)
+ continue;
+
+ /* extract and convert the index */
+ idx = 0;
+ for (k = i+3; k < addr; ++k) {
+ c = env_get_char(k);
+ val = c - '0';
+ if (!isdigit(c))
+ break;
+ idx = idx*10 + val;
}
-#endif
-#if defined(CONFIG_HAS_ETH3)
- path = fdt_getprop(fdt, node, "ethernet3", NULL);
- if (path) {
- do_fixup_by_path(fdt, path, "mac-address",
- bd->bi_enet3addr, 6, 0);
- do_fixup_by_path(fdt, path, "local-mac-address",
- bd->bi_enet3addr, 6, 1);
+
+ /* we didnt parse all chars as digits */
+ if (k != addr)
+ continue;
+
+ /* extract mac address */
+ for (k = addr + 5, j = 0, val = 0; k < nxt; ++k) {
+ int tmp;
+ c = env_get_char(k);
+
+ if (isxdigit(c)) {
+ if (isdigit(c))
+ tmp = c -'0';
+ else
+ tmp = (islower(c) ?
+ toupper(c) : c) - 'A' + 10;
+ val = val * 16 + tmp;
+ } else {
+ mac_addr[j++] = val;
+ val = 0;
+ }
}
-#endif
+ mac_addr[j] = val;
+
+ fdt_fixup_one_mac(fdt, node, idx, &mac_addr);
}
}
-#endif
#ifdef CONFIG_HAS_FSL_DR_USB
void fdt_fixup_dr_usb(void *blob, bd_t *bd)
diff --git a/cpu/74xx_7xx/cpu.c b/cpu/74xx_7xx/cpu.c
index ea43c9a..c007abc 100644
--- a/cpu/74xx_7xx/cpu.c
+++ b/cpu/74xx_7xx/cpu.c
@@ -314,7 +314,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
}
#endif
/* ------------------------------------------------------------------------- */
diff --git a/cpu/mpc512x/cpu.c b/cpu/mpc512x/cpu.c
index 703e188..1f39ac4 100644
--- a/cpu/mpc512x/cpu.c
+++ b/cpu/mpc512x/cpu.c
@@ -191,7 +191,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#endif
ft_clock_setup(blob, bd);
#ifdef CONFIG_HAS_ETH0
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
}
#endif
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 4d5d141..efb8ed6 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -307,7 +307,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
diff --git a/cpu/mpc83xx/fdt.c b/cpu/mpc83xx/fdt.c
index fda85c1..39bd9dc 100644
--- a/cpu/mpc83xx/fdt.c
+++ b/cpu/mpc83xx/fdt.c
@@ -53,7 +53,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc85xx/fdt.c b/cpu/mpc85xx/fdt.c
index c159934..bc1550d 100644
--- a/cpu/mpc85xx/fdt.c
+++ b/cpu/mpc85xx/fdt.c
@@ -212,7 +212,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) ||\
defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
diff --git a/cpu/mpc86xx/fdt.c b/cpu/mpc86xx/fdt.c
index 80a5c78..12d9052 100644
--- a/cpu/mpc86xx/fdt.c
+++ b/cpu/mpc86xx/fdt.c
@@ -25,7 +25,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
#if defined(CONFIG_HAS_ETH0) || defined(CONFIG_HAS_ETH1) \
|| defined(CONFIG_HAS_ETH2) || defined(CONFIG_HAS_ETH3)
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
#endif
#ifdef CFG_NS16550
diff --git a/cpu/mpc8xx/fdt.c b/cpu/mpc8xx/fdt.c
index 567094a..7130983 100644
--- a/cpu/mpc8xx/fdt.c
+++ b/cpu/mpc8xx/fdt.c
@@ -40,7 +40,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
gd->brg_clk, 1);
/* Fixup ethernet MAC addresses */
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}
diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index 0323dc5..a97484f 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -130,7 +130,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
* Fixup all ethernet nodes
* Note: aliases in the dts are required for this
*/
- fdt_fixup_ethernet(blob, bd);
+ fdt_fixup_ethernet(blob);
/*
* Fixup all available PCIe nodes by setting the device_type property
diff --git a/include/common.h b/include/common.h
index 06ed278..eb865f3 100644
--- a/include/common.h
+++ b/include/common.h
@@ -241,6 +241,7 @@ extern ulong load_addr; /* Default Load Address */
int env_init (void);
void env_relocate (void);
int envmatch (uchar *, int);
+int envcmp (const void *s1, int i2, size_t count);
char *getenv (char *);
int getenv_r (char *name, char *buf, unsigned len);
int saveenv (void);
@@ -260,6 +261,7 @@ void forceenv (char *, char *);
#ifdef CONFIG_I386 /* x86 version to be fixed! */
# include <asm/u-boot-i386.h>
#endif /* CONFIG_I386 */
+uchar env_get_char (int index);
#ifdef CONFIG_AUTO_COMPLETE
int env_complete(char *var, int maxv, char *cmdv[], int maxsz, char *buf);
diff --git a/include/fdt_support.h b/include/fdt_support.h
index a7c6326..f2f2cd5 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -45,7 +45,7 @@ void do_fixup_by_compat(void *fdt, const char *compat,
void do_fixup_by_compat_u32(void *fdt, const char *compat,
const char *prop, u32 val, int create);
int fdt_fixup_memory(void *blob, u64 start, u64 size);
-void fdt_fixup_ethernet(void *fdt, bd_t *bd);
+void fdt_fixup_ethernet(void *fdt);
int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
const void *val, int len, int create);
void fdt_fixup_qe_firmware(void *fdt);
--
1.5.5.1
3
3

19 Aug '08
move mvBL-M7 board to matrix_vision subdir and fix config file
to use MKSTR for default environment.
Signed-off-by: Andre Schwarz <andre.schwarz(a)matrix-vision.de>
---
MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler - Registergericht: Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
Makefile | 2 +-
board/matrix_vision/mvblm7/Makefile | 48 +++++++
board/matrix_vision/mvblm7/config.mk | 25 ++++
board/matrix_vision/mvblm7/fpga.c | 188 ++++++++++++++++++++++++++
board/matrix_vision/mvblm7/fpga.h | 34 +++++
board/matrix_vision/mvblm7/mvblm7.c | 157 +++++++++++++++++++++
board/matrix_vision/mvblm7/mvblm7.h | 21 +++
board/matrix_vision/mvblm7/mvblm7_autoscript | 43 ++++++
board/matrix_vision/mvblm7/pci.c | 133 ++++++++++++++++++
board/mvblm7/Makefile | 48 -------
board/mvblm7/config.mk | 25 ----
board/mvblm7/fpga.c | 188 --------------------------
board/mvblm7/fpga.h | 34 -----
board/mvblm7/mvblm7.c | 157 ---------------------
board/mvblm7/mvblm7.h | 21 ---
board/mvblm7/mvblm7_autoscript | 37 -----
board/mvblm7/pci.c | 133 ------------------
include/configs/MVBLM7.h | 56 ++++----
18 files changed, 679 insertions(+), 671 deletions(-)
diff --git a/Makefile b/Makefile
index abe366c..2c81f2a 100644
--- a/Makefile
+++ b/Makefile
@@ -2175,7 +2175,7 @@ MPC837XERDB_config: unconfig
@$(MKCONFIG) -a MPC837XERDB ppc mpc83xx mpc837xerdb freescale
MVBLM7_config: unconfig
- @$(MKCONFIG) $(@:_config=) ppc mpc83xx mvblm7
+ @$(MKCONFIG) $(@:_config=) ppc mpc83xx mvblm7 matrix_vision
sbc8349_config: unconfig
@$(MKCONFIG) $(@:_config=) ppc mpc83xx sbc8349
diff --git a/board/matrix_vision/mvblm7/Makefile b/board/matrix_vision/mvblm7/Makefile
new file mode 100644
index 0000000..cfbecfb
--- /dev/null
+++ b/board/matrix_vision/mvblm7/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+#
+# 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 := $(BOARD).o pci.o fpga.o
+
+SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS := $(addprefix $(obj),$(COBJS))
+SOBJS := $(addprefix $(obj),$(SOBJS))
+
+$(LIB): $(obj).depend $(OBJS)
+ $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+ rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+ rm -f $(LIB) core *.bak $(obj).depend
+
+#########################################################################
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
diff --git a/board/matrix_vision/mvblm7/config.mk b/board/matrix_vision/mvblm7/config.mk
new file mode 100644
index 0000000..1d85f4f
--- /dev/null
+++ b/board/matrix_vision/mvblm7/config.mk
@@ -0,0 +1,25 @@
+#
+# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+#
+# 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
+#
+
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
+
+TEXT_BASE = 0xFFF00000
diff --git a/board/matrix_vision/mvblm7/fpga.c b/board/matrix_vision/mvblm7/fpga.c
new file mode 100644
index 0000000..a60af01
--- /dev/null
+++ b/board/matrix_vision/mvblm7/fpga.c
@@ -0,0 +1,188 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.com.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.de
+ *
+ * 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 <ACEX1K.h>
+#include <command.h>
+#include "fpga.h"
+#include "mvblm7.h"
+
+#ifdef FPGA_DEBUG
+#define fpga_debug(fmt, args...) printf("%s: "fmt, __func__, ##args)
+#else
+#define fpga_debug(fmt, args...)
+#endif
+
+Altera_CYC2_Passive_Serial_fns altera_fns = {
+ fpga_null_fn,
+ fpga_config_fn,
+ fpga_status_fn,
+ fpga_done_fn,
+ fpga_wr_fn,
+ fpga_null_fn,
+ fpga_null_fn,
+ 0
+};
+
+Altera_desc cyclone2 = {
+ Altera_CYC2,
+ passive_serial,
+ Altera_EP2C20_SIZE,
+ (void *) &altera_fns,
+ NULL,
+ 0
+};
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvblm7_init_fpga(void)
+{
+ fpga_debug("Initialize FPGA interface (reloc 0x%.8lx)\n",
+ gd->reloc_off);
+ fpga_init(gd->reloc_off);
+ fpga_add(fpga_altera, &cyclone2);
+ fpga_config_fn(0, 1, 0);
+ udelay(60);
+
+ return 1;
+}
+
+int fpga_null_fn(int cookie)
+{
+ return 0;
+}
+
+int fpga_config_fn(int assert, int flush, int cookie)
+{
+ volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+ volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+ u32 dvo = gpio->dat;
+
+ fpga_debug("SET config : %s\n", assert ? "low" : "high");
+ if (assert)
+ dvo |= FPGA_CONFIG;
+ else
+ dvo &= ~FPGA_CONFIG;
+
+ if (flush)
+ gpio->dat = dvo;
+
+ return assert;
+}
+
+int fpga_done_fn(int cookie)
+{
+ volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+ volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+ int result = 0;
+
+ udelay(10);
+ fpga_debug("CONF_DONE check ... ");
+ if (gpio->dat & FPGA_CONF_DONE) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_status_fn(int cookie)
+{
+ volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+ volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+ int result = 0;
+
+ fpga_debug("STATUS check ... ");
+ if (gpio->dat & FPGA_STATUS) {
+ fpga_debug("high\n");
+ result = 1;
+ } else
+ fpga_debug("low\n");
+
+ return result;
+}
+
+int fpga_clk_fn(int assert_clk, int flush, int cookie)
+{
+ volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+ volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+ u32 dvo = gpio->dat;
+
+ fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
+ if (assert_clk)
+ dvo |= FPGA_CCLK;
+ else
+ dvo &= ~FPGA_CCLK;
+
+ if (flush)
+ gpio->dat = dvo;
+
+ return assert_clk;
+}
+
+static inline int _write_fpga(u8 val, int dump)
+{
+ volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
+ volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
+ int i;
+ u32 dvo = gpio->dat;
+
+ if (dump)
+ fpga_debug(" %02x -> ", val);
+ for (i = 0; i < 8; i++) {
+ dvo &= ~FPGA_CCLK;
+ gpio->dat = dvo;
+ dvo &= ~FPGA_DIN;
+ if (dump)
+ fpga_debug("%d ", val&1);
+ if (val & 1)
+ dvo |= FPGA_DIN;
+ gpio->dat = dvo;
+ dvo |= FPGA_CCLK;
+ gpio->dat = dvo;
+ val >>= 1;
+ }
+ if (dump)
+ fpga_debug("\n");
+
+ return 0;
+}
+
+int fpga_wr_fn(void *buf, size_t len, int flush, int cookie)
+{
+ unsigned char *data = (unsigned char *) buf;
+ int i;
+
+ fpga_debug("fpga_wr: buf %p / size %d\n", buf, len);
+ for (i = 0; i < len; i++)
+ _write_fpga(data[i], 0);
+ fpga_debug("\n");
+
+ return FPGA_SUCCESS;
+}
diff --git a/board/matrix_vision/mvblm7/fpga.h b/board/matrix_vision/mvblm7/fpga.h
new file mode 100644
index 0000000..19277eb
--- /dev/null
+++ b/board/matrix_vision/mvblm7/fpga.h
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2002
+ * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
+ * Keith Outwater, keith_outwater(a)mvis.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
+ *
+ */
+
+extern int mvblm7_init_fpga(void);
+
+extern int fpga_pgm_fn(int assert_pgm, int flush, int cookie);
+extern int fpga_status_fn(int cookie);
+extern int fpga_config_fn(int assert, int flush, int cookie);
+extern int fpga_done_fn(int cookie);
+extern int fpga_clk_fn(int assert_clk, int flush, int cookie);
+extern int fpga_wr_fn(void *buf, size_t len, int flush, int cookie);
+extern int fpga_null_fn(int cookie);
diff --git a/board/matrix_vision/mvblm7/mvblm7.c b/board/matrix_vision/mvblm7/mvblm7.c
new file mode 100644
index 0000000..b07f913
--- /dev/null
+++ b/board/matrix_vision/mvblm7/mvblm7.c
@@ -0,0 +1,157 @@
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.de
+ *
+ * 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 <ioports.h>
+#include <mpc83xx.h>
+#include <asm/mpc8349_pci.h>
+#include <pci.h>
+#include <spi.h>
+#include <asm/mmu.h>
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#endif
+
+#include "mvblm7.h"
+
+int fixed_sdram(void)
+{
+ volatile immap_t *im = (immap_t *)CFG_IMMR;
+ u32 msize = 0;
+ u32 ddr_size;
+ u32 ddr_size_log2;
+
+ msize = CFG_DDR_SIZE;
+ for (ddr_size = msize << 20, ddr_size_log2 = 0;
+ (ddr_size > 1);
+ ddr_size = ddr_size >> 1, ddr_size_log2++) {
+ if (ddr_size & 1)
+ return -1;
+ }
+ im->sysconf.ddrlaw[0].bar = ((CFG_DDR_SDRAM_BASE>>12) & 0xfffff);
+ im->sysconf.ddrlaw[0].ar = LAWAR_EN | ((ddr_size_log2 - 1) &
+ LAWAR_SIZE);
+
+ im->ddr.csbnds[0].csbnds = CFG_DDR_CS0_BNDS;
+ im->ddr.cs_config[0] = CFG_DDR_CS0_CONFIG;
+ im->ddr.timing_cfg_0 = CFG_DDR_TIMING_0;
+ im->ddr.timing_cfg_1 = CFG_DDR_TIMING_1;
+ im->ddr.timing_cfg_2 = CFG_DDR_TIMING_2;
+ im->ddr.timing_cfg_3 = CFG_DDR_TIMING_3;
+ im->ddr.sdram_cfg = CFG_DDR_SDRAM_CFG;
+ im->ddr.sdram_cfg2 = CFG_DDR_SDRAM_CFG2;
+ im->ddr.sdram_mode = CFG_DDR_MODE;
+ im->ddr.sdram_interval = CFG_DDR_INTERVAL;
+ im->ddr.sdram_clk_cntl = CFG_DDR_CLK_CNTL;
+
+ udelay(300);
+
+ im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
+
+ return CFG_DDR_SIZE;
+}
+
+phys_size_t initdram(int board_type)
+{
+ volatile immap_t *im = (immap_t *) CFG_IMMR;
+ u32 msize = 0;
+
+ if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
+ return -1;
+
+ im->sysconf.ddrlaw[0].bar = CFG_DDR_BASE & LAWBAR_BAR;
+ msize = fixed_sdram();
+
+ /* return total bus RAM size(bytes) */
+ return msize * 1024 * 1024;
+}
+
+int checkboard(void)
+{
+ puts("Board: Matrix Vision mvBlueLYNX-M7\n");
+
+ return 0;
+}
+
+u8 *dhcp_vendorex_prep(u8 *e)
+{
+ char *ptr;
+
+ /* DHCP vendor-class-identifier = 60 */
+ ptr = getenv("dhcp_vendor-class-identifier");
+ if (ptr) {
+ *e++ = 60;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+ /* DHCP_CLIENT_IDENTIFIER = 61 */
+ ptr = getenv("dhcp_client_id");
+ if (ptr) {
+ *e++ = 61;
+ *e++ = strlen(ptr);
+ while (*ptr)
+ *e++ = *ptr++;
+ }
+
+ return e;
+}
+
+u8 *dhcp_vendorex_proc(u8 *popt)
+{
+ return NULL;
+}
+
+#ifdef CONFIG_HARD_SPI
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+ return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+ volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
+
+ iopd->dat &= ~MVBLM7_MMC_CS;
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+ volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
+
+ iopd->dat |= ~MVBLM7_MMC_CS;
+}
+#endif
+
+#if defined(CONFIG_OF_BOARD_SETUP)
+void ft_board_setup(void *blob, bd_t *bd)
+{
+ ft_cpu_setup(blob, bd);
+#ifdef CONFIG_PCI
+ ft_pci_setup(blob, bd);
+#endif
+}
+
+#endif
diff --git a/board/matrix_vision/mvblm7/mvblm7.h b/board/matrix_vision/mvblm7/mvblm7.h
new file mode 100644
index 0000000..03e9f41
--- /dev/null
+++ b/board/matrix_vision/mvblm7/mvblm7.h
@@ -0,0 +1,21 @@
+#ifndef __MVBC_H__
+#define __MVBC_H__
+
+#define MV_GPIO
+
+#define FPGA_CONFIG 0x80000000
+#define FPGA_CCLK 0x40000000
+#define FPGA_DIN 0x20000000
+#define FPGA_STATUS 0x10000000
+#define FPGA_CONF_DONE 0x08000000
+#define MMC_CS 0x04000000
+
+#define WD_WDI 0x00400000
+#define WD_TS 0x00200000
+#define MAN_RST 0x00100000
+
+#define MV_GPIO_DAT (WD_TS)
+#define MV_GPIO_OUT (FPGA_CONFIG|FPGA_DIN|FPGA_CCLK|WD_TS|WD_WDI|MMC_CS)
+#define MV_GPIO_ODE (FPGA_CONFIG|MAN_RST)
+
+#endif
diff --git a/board/matrix_vision/mvblm7/mvblm7_autoscript b/board/matrix_vision/mvblm7/mvblm7_autoscript
new file mode 100644
index 0000000..6f9357f
--- /dev/null
+++ b/board/matrix_vision/mvblm7/mvblm7_autoscript
@@ -0,0 +1,43 @@
+echo
+echo "==== running autoscript ===="
+echo
+setenv bootdtb bootm \${kernel_boot} \${mv_initrd_addr_ram} \${mv_dtb_addr_ram}
+setenv ramkernel setenv kernel_boot \${loadaddr}
+setenv flashkernel setenv kernel_boot \${mv_kernel_addr}
+setenv cpird cp \${mv_initrd_addr} \${mv_initrd_addr_ram} \${mv_initrd_length}
+setenv bootfromflash run flashkernel cpird ramparam addcons bootdtb
+setenv getdtb tftp \${mv_dtb_addr_ram} \${dtb_name}
+setenv cpdtb cp \${mv_dtb_addr} \${mv_dtb_addr_ram} 0x2000
+setenv rundtb fdt addr \${mv_dtb_addr_ram}\;fdt boardsetup
+setenv bootfromnet tftp \${mv_initrd_addr_ram} \${initrd_name}\;run ramkernel
+if test ${console} = yes;
+then
+setenv addcons setenv bootargs \${bootargs} console=ttyS\${console_nr},\${baudrate}N8
+else
+setenv addcons setenv bootargs \${bootargs} console=tty0
+fi
+setenv set_static_ip setenv ipaddr \${static_ipaddr}
+setenv set_static_nm setenv netmask \${static_netmask}
+setenv set_static_gw setenv gatewayip \${static_gateway}
+setenv set_ip setenv ip \${ipaddr}::\${gatewayip}:\${netmask}
+setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs
+if test ${autoscr_boot} != no;
+then
+ if test ${netboot} = yes;
+ then
+ bootp
+ if test $? = 0;
+ then
+ echo "=== bootp succeeded -> netboot ==="
+ run set_ip
+ run getdtb rundtb bootfromnet ramparam addcons bootdtb
+ else
+ echo "=== netboot failed ==="
+ fi
+ fi
+ run set_static_ip set_static_nm set_static_gw set_ip
+ echo "=== bootfromflash ==="
+ run cpdtb rundtb bootfromflash
+else
+ echo "=== boot stopped with autoscr_boot no ==="
+fi
diff --git a/board/matrix_vision/mvblm7/pci.c b/board/matrix_vision/mvblm7/pci.c
new file mode 100644
index 0000000..ef34a6b
--- /dev/null
+++ b/board/matrix_vision/mvblm7/pci.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
+ *
+ * (C) Copyright 2008
+ * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.de
+ *
+ * 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>
+#if defined(CONFIG_OF_LIBFDT)
+#include <libfdt.h>
+#endif
+#include <pci.h>
+#include <mpc83xx.h>
+#include <fpga.h>
+#include "mvblm7.h"
+#include "fpga.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int mvblm7_load_fpga(void)
+{
+ size_t data_size = 0;
+ void *fpga_data = NULL;
+ char *datastr = getenv("fpgadata");
+ char *sizestr = getenv("fpgadatasize");
+
+ if (datastr)
+ fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
+ if (sizestr)
+ data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
+
+ return fpga_load(0, fpga_data, data_size);
+}
+
+static struct pci_region pci_regions[] = {
+ {
+ bus_start: CFG_PCI1_MEM_BASE,
+ phys_start: CFG_PCI1_MEM_PHYS,
+ size: CFG_PCI1_MEM_SIZE,
+ flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
+ },
+ {
+ bus_start: CFG_PCI1_MMIO_BASE,
+ phys_start: CFG_PCI1_MMIO_PHYS,
+ size: CFG_PCI1_MMIO_SIZE,
+ flags: PCI_REGION_MEM
+ },
+ {
+ bus_start: CFG_PCI1_IO_BASE,
+ phys_start: CFG_PCI1_IO_PHYS,
+ size: CFG_PCI1_IO_SIZE,
+ flags: PCI_REGION_IO
+ }
+};
+
+void pci_init_board(void)
+{
+ char *s;
+ int i;
+ int warmboot;
+ int load_fpga;
+ volatile immap_t *immr;
+ volatile pcictrl83xx_t *pci_ctrl;
+ volatile gpio83xx_t *gpio;
+ volatile clk83xx_t *clk;
+ volatile law83xx_t *pci_law;
+ struct pci_region *reg[] = { pci_regions };
+
+ load_fpga = 1;
+ immr = (immap_t *) CFG_IMMR;
+ clk = (clk83xx_t *) &immr->clk;
+ pci_ctrl = immr->pci_ctrl;
+ pci_law = immr->sysconf.pcilaw;
+ gpio = (volatile gpio83xx_t *)&immr->gpio[0];
+
+ s = getenv("skip_fpga");
+ if (s) {
+ printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
+ load_fpga = 0;
+ }
+
+ gpio->dat = MV_GPIO_DAT;
+ gpio->odr = MV_GPIO_ODE;
+ if (load_fpga)
+ gpio->dir = MV_GPIO_OUT;
+ else
+ gpio->dir = MV_GPIO_OUT & ~(FPGA_DIN|FPGA_CCLK);
+
+ printf("SICRH / SICRL : 0x%08x / 0x%08x\n", immr->sysconf.sicrh,
+ immr->sysconf.sicrl);
+
+ mvblm7_init_fpga();
+ if (load_fpga)
+ mvblm7_load_fpga();
+
+ /* Enable PCI_CLK_OUTPUTs 0 and 1 with 1:1 clocking */
+ clk->occr = 0xc0000000;
+
+ pci_ctrl[0].gcr = 0;
+ udelay(2000);
+ pci_ctrl[0].gcr = 1;
+
+ for (i = 0; i < 1000; ++i)
+ udelay(1000);
+
+ pci_law[0].bar = CFG_PCI1_MEM_PHYS & LAWBAR_BAR;
+ pci_law[0].ar = LBLAWAR_EN | LBLAWAR_1GB;
+
+ pci_law[1].bar = CFG_PCI1_IO_PHYS & LAWBAR_BAR;
+ pci_law[1].ar = LBLAWAR_EN | LBLAWAR_1MB;
+
+ warmboot = gd->bd->bi_bootflags & BOOTFLAG_WARM;
+
+ mpc83xx_pci_init(1, reg, warmboot);
+}
diff --git a/board/mvblm7/Makefile b/board/mvblm7/Makefile
deleted file mode 100644
index cfbecfb..0000000
--- a/board/mvblm7/Makefile
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
-#
-# 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 := $(BOARD).o pci.o fpga.o
-
-SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS := $(addprefix $(obj),$(COBJS))
-SOBJS := $(addprefix $(obj),$(SOBJS))
-
-$(LIB): $(obj).depend $(OBJS)
- $(AR) $(ARFLAGS) $@ $(OBJS)
-
-clean:
- rm -f $(SOBJS) $(OBJS)
-
-distclean: clean
- rm -f $(LIB) core *.bak $(obj).depend
-
-#########################################################################
-
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
diff --git a/board/mvblm7/config.mk b/board/mvblm7/config.mk
deleted file mode 100644
index 1d85f4f..0000000
--- a/board/mvblm7/config.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
-#
-# 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
-#
-
-sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
-
-TEXT_BASE = 0xFFF00000
diff --git a/board/mvblm7/fpga.c b/board/mvblm7/fpga.c
deleted file mode 100644
index a60af01..0000000
--- a/board/mvblm7/fpga.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * (C) Copyright 2002
- * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
- * Keith Outwater, keith_outwater(a)mvis.com.
- *
- * (C) Copyright 2008
- * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.de
- *
- * 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 <ACEX1K.h>
-#include <command.h>
-#include "fpga.h"
-#include "mvblm7.h"
-
-#ifdef FPGA_DEBUG
-#define fpga_debug(fmt, args...) printf("%s: "fmt, __func__, ##args)
-#else
-#define fpga_debug(fmt, args...)
-#endif
-
-Altera_CYC2_Passive_Serial_fns altera_fns = {
- fpga_null_fn,
- fpga_config_fn,
- fpga_status_fn,
- fpga_done_fn,
- fpga_wr_fn,
- fpga_null_fn,
- fpga_null_fn,
- 0
-};
-
-Altera_desc cyclone2 = {
- Altera_CYC2,
- passive_serial,
- Altera_EP2C20_SIZE,
- (void *) &altera_fns,
- NULL,
- 0
-};
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int mvblm7_init_fpga(void)
-{
- fpga_debug("Initialize FPGA interface (reloc 0x%.8lx)\n",
- gd->reloc_off);
- fpga_init(gd->reloc_off);
- fpga_add(fpga_altera, &cyclone2);
- fpga_config_fn(0, 1, 0);
- udelay(60);
-
- return 1;
-}
-
-int fpga_null_fn(int cookie)
-{
- return 0;
-}
-
-int fpga_config_fn(int assert, int flush, int cookie)
-{
- volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
- volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
- u32 dvo = gpio->dat;
-
- fpga_debug("SET config : %s\n", assert ? "low" : "high");
- if (assert)
- dvo |= FPGA_CONFIG;
- else
- dvo &= ~FPGA_CONFIG;
-
- if (flush)
- gpio->dat = dvo;
-
- return assert;
-}
-
-int fpga_done_fn(int cookie)
-{
- volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
- volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
- int result = 0;
-
- udelay(10);
- fpga_debug("CONF_DONE check ... ");
- if (gpio->dat & FPGA_CONF_DONE) {
- fpga_debug("high\n");
- result = 1;
- } else
- fpga_debug("low\n");
-
- return result;
-}
-
-int fpga_status_fn(int cookie)
-{
- volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
- volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
- int result = 0;
-
- fpga_debug("STATUS check ... ");
- if (gpio->dat & FPGA_STATUS) {
- fpga_debug("high\n");
- result = 1;
- } else
- fpga_debug("low\n");
-
- return result;
-}
-
-int fpga_clk_fn(int assert_clk, int flush, int cookie)
-{
- volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
- volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
- u32 dvo = gpio->dat;
-
- fpga_debug("CLOCK %s\n", assert_clk ? "high" : "low");
- if (assert_clk)
- dvo |= FPGA_CCLK;
- else
- dvo &= ~FPGA_CCLK;
-
- if (flush)
- gpio->dat = dvo;
-
- return assert_clk;
-}
-
-static inline int _write_fpga(u8 val, int dump)
-{
- volatile immap_t *im = (volatile immap_t *)CFG_IMMR;
- volatile gpio83xx_t *gpio = (volatile gpio83xx_t *)&im->gpio[0];
- int i;
- u32 dvo = gpio->dat;
-
- if (dump)
- fpga_debug(" %02x -> ", val);
- for (i = 0; i < 8; i++) {
- dvo &= ~FPGA_CCLK;
- gpio->dat = dvo;
- dvo &= ~FPGA_DIN;
- if (dump)
- fpga_debug("%d ", val&1);
- if (val & 1)
- dvo |= FPGA_DIN;
- gpio->dat = dvo;
- dvo |= FPGA_CCLK;
- gpio->dat = dvo;
- val >>= 1;
- }
- if (dump)
- fpga_debug("\n");
-
- return 0;
-}
-
-int fpga_wr_fn(void *buf, size_t len, int flush, int cookie)
-{
- unsigned char *data = (unsigned char *) buf;
- int i;
-
- fpga_debug("fpga_wr: buf %p / size %d\n", buf, len);
- for (i = 0; i < len; i++)
- _write_fpga(data[i], 0);
- fpga_debug("\n");
-
- return FPGA_SUCCESS;
-}
diff --git a/board/mvblm7/fpga.h b/board/mvblm7/fpga.h
deleted file mode 100644
index 19277eb..0000000
--- a/board/mvblm7/fpga.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * (C) Copyright 2002
- * Rich Ireland, Enterasys Networks, rireland(a)enterasys.com.
- * Keith Outwater, keith_outwater(a)mvis.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
- *
- */
-
-extern int mvblm7_init_fpga(void);
-
-extern int fpga_pgm_fn(int assert_pgm, int flush, int cookie);
-extern int fpga_status_fn(int cookie);
-extern int fpga_config_fn(int assert, int flush, int cookie);
-extern int fpga_done_fn(int cookie);
-extern int fpga_clk_fn(int assert_clk, int flush, int cookie);
-extern int fpga_wr_fn(void *buf, size_t len, int flush, int cookie);
-extern int fpga_null_fn(int cookie);
diff --git a/board/mvblm7/mvblm7.c b/board/mvblm7/mvblm7.c
deleted file mode 100644
index b07f913..0000000
--- a/board/mvblm7/mvblm7.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
- *
- * (C) Copyright 2008
- * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.de
- *
- * 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 <ioports.h>
-#include <mpc83xx.h>
-#include <asm/mpc8349_pci.h>
-#include <pci.h>
-#include <spi.h>
-#include <asm/mmu.h>
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#endif
-
-#include "mvblm7.h"
-
-int fixed_sdram(void)
-{
- volatile immap_t *im = (immap_t *)CFG_IMMR;
- u32 msize = 0;
- u32 ddr_size;
- u32 ddr_size_log2;
-
- msize = CFG_DDR_SIZE;
- for (ddr_size = msize << 20, ddr_size_log2 = 0;
- (ddr_size > 1);
- ddr_size = ddr_size >> 1, ddr_size_log2++) {
- if (ddr_size & 1)
- return -1;
- }
- im->sysconf.ddrlaw[0].bar = ((CFG_DDR_SDRAM_BASE>>12) & 0xfffff);
- im->sysconf.ddrlaw[0].ar = LAWAR_EN | ((ddr_size_log2 - 1) &
- LAWAR_SIZE);
-
- im->ddr.csbnds[0].csbnds = CFG_DDR_CS0_BNDS;
- im->ddr.cs_config[0] = CFG_DDR_CS0_CONFIG;
- im->ddr.timing_cfg_0 = CFG_DDR_TIMING_0;
- im->ddr.timing_cfg_1 = CFG_DDR_TIMING_1;
- im->ddr.timing_cfg_2 = CFG_DDR_TIMING_2;
- im->ddr.timing_cfg_3 = CFG_DDR_TIMING_3;
- im->ddr.sdram_cfg = CFG_DDR_SDRAM_CFG;
- im->ddr.sdram_cfg2 = CFG_DDR_SDRAM_CFG2;
- im->ddr.sdram_mode = CFG_DDR_MODE;
- im->ddr.sdram_interval = CFG_DDR_INTERVAL;
- im->ddr.sdram_clk_cntl = CFG_DDR_CLK_CNTL;
-
- udelay(300);
-
- im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
-
- return CFG_DDR_SIZE;
-}
-
-phys_size_t initdram(int board_type)
-{
- volatile immap_t *im = (immap_t *) CFG_IMMR;
- u32 msize = 0;
-
- if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32) im)
- return -1;
-
- im->sysconf.ddrlaw[0].bar = CFG_DDR_BASE & LAWBAR_BAR;
- msize = fixed_sdram();
-
- /* return total bus RAM size(bytes) */
- return msize * 1024 * 1024;
-}
-
-int checkboard(void)
-{
- puts("Board: Matrix Vision mvBlueLYNX-M7\n");
-
- return 0;
-}
-
-u8 *dhcp_vendorex_prep(u8 *e)
-{
- char *ptr;
-
- /* DHCP vendor-class-identifier = 60 */
- ptr = getenv("dhcp_vendor-class-identifier");
- if (ptr) {
- *e++ = 60;
- *e++ = strlen(ptr);
- while (*ptr)
- *e++ = *ptr++;
- }
- /* DHCP_CLIENT_IDENTIFIER = 61 */
- ptr = getenv("dhcp_client_id");
- if (ptr) {
- *e++ = 61;
- *e++ = strlen(ptr);
- while (*ptr)
- *e++ = *ptr++;
- }
-
- return e;
-}
-
-u8 *dhcp_vendorex_proc(u8 *popt)
-{
- return NULL;
-}
-
-#ifdef CONFIG_HARD_SPI
-int spi_cs_is_valid(unsigned int bus, unsigned int cs)
-{
- return bus == 0 && cs == 0;
-}
-
-void spi_cs_activate(struct spi_slave *slave)
-{
- volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
-
- iopd->dat &= ~MVBLM7_MMC_CS;
-}
-
-void spi_cs_deactivate(struct spi_slave *slave)
-{
- volatile gpio83xx_t *iopd = &((immap_t *)CFG_IMMR)->gpio[0];
-
- iopd->dat |= ~MVBLM7_MMC_CS;
-}
-#endif
-
-#if defined(CONFIG_OF_BOARD_SETUP)
-void ft_board_setup(void *blob, bd_t *bd)
-{
- ft_cpu_setup(blob, bd);
-#ifdef CONFIG_PCI
- ft_pci_setup(blob, bd);
-#endif
-}
-
-#endif
diff --git a/board/mvblm7/mvblm7.h b/board/mvblm7/mvblm7.h
deleted file mode 100644
index 03e9f41..0000000
--- a/board/mvblm7/mvblm7.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#ifndef __MVBC_H__
-#define __MVBC_H__
-
-#define MV_GPIO
-
-#define FPGA_CONFIG 0x80000000
-#define FPGA_CCLK 0x40000000
-#define FPGA_DIN 0x20000000
-#define FPGA_STATUS 0x10000000
-#define FPGA_CONF_DONE 0x08000000
-#define MMC_CS 0x04000000
-
-#define WD_WDI 0x00400000
-#define WD_TS 0x00200000
-#define MAN_RST 0x00100000
-
-#define MV_GPIO_DAT (WD_TS)
-#define MV_GPIO_OUT (FPGA_CONFIG|FPGA_DIN|FPGA_CCLK|WD_TS|WD_WDI|MMC_CS)
-#define MV_GPIO_ODE (FPGA_CONFIG|MAN_RST)
-
-#endif
diff --git a/board/mvblm7/mvblm7_autoscript b/board/mvblm7/mvblm7_autoscript
deleted file mode 100644
index ec6e34e..0000000
--- a/board/mvblm7/mvblm7_autoscript
+++ /dev/null
@@ -1,37 +0,0 @@
-echo
-echo "==== running autoscript ===="
-echo
-setenv bootdtb bootm \${kernel_boot} \${mv_initrd_addr_ram} \${mv_dtb_addr_ram}
-setenv ramkernel setenv kernel_boot \${loadaddr}
-setenv flashkernel setenv kernel_boot \${mv_kernel_addr}
-setenv cpird cp \${mv_initrd_addr} \${mv_initrd_addr_ram} \${mv_initrd_length}
-setenv bootfromflash run flashkernel cpird ramparam bootdtb
-setenv getdtb tftp \${mv_dtb_addr_ram} \${dtb_name}
-setenv cpdtb cp \${mv_dtb_addr} \${mv_dtb_addr_ram} 0x2000
-setenv rundtb fdt addr \${mv_dtb_addr_ram}\;fdt boardsetup
-setenv bootfromnet tftp \${mv_initrd_addr_ram} \${initrd_name}\;run ramkernel
-setenv set_static_ip setenv ipaddr \${static_ipaddr}
-setenv set_static_nm setenv netmask \${static_netmask}
-setenv set_static_gw setenv gatewayip \${static_gateway}
-setenv set_ip setenv ip \${ipaddr}::\${gatewayip}:\${netmask}
-setenv ramparam setenv bootargs root=/dev/ram0 ro rootfstype=squashfs
-if test ${autoscr_boot} != no;
-then
- if test ${netboot} = yes;
- then
- bootp
- if test $? = 0;
- then
- echo "=== bootp succeeded -> netboot ==="
- run set_ip
- run getdtb rundtb bootfromnet ramparam bootdtb
- else
- echo "=== netboot failed ==="
- fi
- fi
- run set_static_ip set_static_nm set_static_gw set_ip
- echo "=== bootfromflash ==="
- run cpdtb rundtb bootfromflash
-else
- echo "=== boot stopped with autoscr_boot no ==="
-fi
diff --git a/board/mvblm7/pci.c b/board/mvblm7/pci.c
deleted file mode 100644
index ef34a6b..0000000
--- a/board/mvblm7/pci.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (C) Freescale Semiconductor, Inc. 2006. All rights reserved.
- *
- * (C) Copyright 2008
- * Andre Schwarz, Matrix Vision GmbH, andre.schwarz(a)matrix-vision.de
- *
- * 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>
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#endif
-#include <pci.h>
-#include <mpc83xx.h>
-#include <fpga.h>
-#include "mvblm7.h"
-#include "fpga.h"
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int mvblm7_load_fpga(void)
-{
- size_t data_size = 0;
- void *fpga_data = NULL;
- char *datastr = getenv("fpgadata");
- char *sizestr = getenv("fpgadatasize");
-
- if (datastr)
- fpga_data = (void *)simple_strtoul(datastr, NULL, 16);
- if (sizestr)
- data_size = (size_t)simple_strtoul(sizestr, NULL, 16);
-
- return fpga_load(0, fpga_data, data_size);
-}
-
-static struct pci_region pci_regions[] = {
- {
- bus_start: CFG_PCI1_MEM_BASE,
- phys_start: CFG_PCI1_MEM_PHYS,
- size: CFG_PCI1_MEM_SIZE,
- flags: PCI_REGION_MEM | PCI_REGION_PREFETCH
- },
- {
- bus_start: CFG_PCI1_MMIO_BASE,
- phys_start: CFG_PCI1_MMIO_PHYS,
- size: CFG_PCI1_MMIO_SIZE,
- flags: PCI_REGION_MEM
- },
- {
- bus_start: CFG_PCI1_IO_BASE,
- phys_start: CFG_PCI1_IO_PHYS,
- size: CFG_PCI1_IO_SIZE,
- flags: PCI_REGION_IO
- }
-};
-
-void pci_init_board(void)
-{
- char *s;
- int i;
- int warmboot;
- int load_fpga;
- volatile immap_t *immr;
- volatile pcictrl83xx_t *pci_ctrl;
- volatile gpio83xx_t *gpio;
- volatile clk83xx_t *clk;
- volatile law83xx_t *pci_law;
- struct pci_region *reg[] = { pci_regions };
-
- load_fpga = 1;
- immr = (immap_t *) CFG_IMMR;
- clk = (clk83xx_t *) &immr->clk;
- pci_ctrl = immr->pci_ctrl;
- pci_law = immr->sysconf.pcilaw;
- gpio = (volatile gpio83xx_t *)&immr->gpio[0];
-
- s = getenv("skip_fpga");
- if (s) {
- printf("found 'skip_fpga' -> FPGA _not_ loaded !\n");
- load_fpga = 0;
- }
-
- gpio->dat = MV_GPIO_DAT;
- gpio->odr = MV_GPIO_ODE;
- if (load_fpga)
- gpio->dir = MV_GPIO_OUT;
- else
- gpio->dir = MV_GPIO_OUT & ~(FPGA_DIN|FPGA_CCLK);
-
- printf("SICRH / SICRL : 0x%08x / 0x%08x\n", immr->sysconf.sicrh,
- immr->sysconf.sicrl);
-
- mvblm7_init_fpga();
- if (load_fpga)
- mvblm7_load_fpga();
-
- /* Enable PCI_CLK_OUTPUTs 0 and 1 with 1:1 clocking */
- clk->occr = 0xc0000000;
-
- pci_ctrl[0].gcr = 0;
- udelay(2000);
- pci_ctrl[0].gcr = 1;
-
- for (i = 0; i < 1000; ++i)
- udelay(1000);
-
- pci_law[0].bar = CFG_PCI1_MEM_PHYS & LAWBAR_BAR;
- pci_law[0].ar = LBLAWAR_EN | LBLAWAR_1GB;
-
- pci_law[1].bar = CFG_PCI1_IO_PHYS & LAWBAR_BAR;
- pci_law[1].ar = LBLAWAR_EN | LBLAWAR_1MB;
-
- warmboot = gd->bd->bi_bootflags & BOOTFLAG_WARM;
-
- mpc83xx_pci_init(1, reg, warmboot);
-}
diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h
index 0dce9b4..849350f 100644
--- a/include/configs/MVBLM7.h
+++ b/include/configs/MVBLM7.h
@@ -406,22 +406,22 @@
#define CONFIG_ZERO_BOOTDELAY_CHECK
#define CONFIG_RESET_TO_RETRY 1000
-#define MV_CI "mvBL-M7"
-#define MV_VCI "mvBL-M7"
-#define MV_FPGA_DATA "0xfff80000"
-#define MV_FPGA_SIZE "0x76ca2"
-#define MV_KERNEL_ADDR "0xff810000"
-#define MV_INITRD_ADDR "0xffc00000"
-#define MV_AUTOSCR_ADDR "0xff804000"
-#define MV_AUTOSCR_ADDR2 "0xff806000"
-#define MV_DTB_ADDR "0xff808000"
-#define MV_INITRD_LENGTH "0x00300000"
+#define MV_CI mvBL-M7
+#define MV_VCI mvBL-M7
+#define MV_FPGA_DATA 0xfff80000
+#define MV_FPGA_SIZE 0x00076ca2
+#define MV_KERNEL_ADDR 0xff810000
+#define MV_INITRD_ADDR 0xffb00000
+#define MV_AUTOSCR_ADDR 0xff804000
+#define MV_AUTOSCR_ADDR2 0xff806000
+#define MV_DTB_ADDR 0xff808000
+#define MV_INITRD_LENGTH 0x00400000
#define CONFIG_SHOW_BOOT_PROGRESS 1
-#define MV_KERNEL_ADDR_RAM "0x00100000"
-#define MV_DTB_ADDR_RAM "0x00600000"
-#define MV_INITRD_ADDR_RAM "0x01000000"
+#define MV_KERNEL_ADDR_RAM 0x00100000
+#define MV_DTB_ADDR_RAM 0x00600000
+#define MV_INITRD_ADDR_RAM 0x01000000
#define CONFIG_BOOTCOMMAND "if imi ${autoscr_addr}; \
then autoscr ${autoscr_addr}; \
@@ -431,25 +431,26 @@
#define CONFIG_EXTRA_ENV_SETTINGS \
"console_nr=0\0" \
+ "baudrate=" MK_STR(CONFIG_BAUDRATE) "\0" \
"stdin=serial\0" \
"stdout=serial\0" \
"stderr=serial\0" \
"fpga=0\0" \
- "fpgadata=" MV_FPGA_DATA "\0" \
- "fpgadatasize=" MV_FPGA_SIZE "\0" \
- "autoscr_addr=" MV_AUTOSCR_ADDR "\0" \
- "autoscr_addr2=" MV_AUTOSCR_ADDR2 "\0" \
- "mv_kernel_addr=" MV_KERNEL_ADDR "\0" \
- "mv_kernel_addr_ram=" MV_KERNEL_ADDR_RAM "\0" \
- "mv_initrd_addr=" MV_INITRD_ADDR "\0" \
- "mv_initrd_addr_ram=" MV_INITRD_ADDR_RAM "\0" \
- "mv_initrd_length=" MV_INITRD_LENGTH "\0" \
- "mv_dtb_addr=" MV_DTB_ADDR "\0" \
- "mv_dtb_addr_ram=" MV_DTB_ADDR_RAM "\0" \
- "dtb_name=" MV_DTB_NAME "\0" \
+ "fpgadata=" MK_STR(MV_FPGA_DATA) "\0" \
+ "fpgadatasize=" MK_STR(MV_FPGA_SIZE) "\0" \
+ "autoscr_addr=" MK_STR(MV_AUTOSCR_ADDR) "\0" \
+ "autoscr_addr2=" MK_STR(MV_AUTOSCR_ADDR2) "\0" \
+ "mv_kernel_addr=" MK_STR(MV_KERNEL_ADDR) "\0" \
+ "mv_kernel_addr_ram=" MK_STR(MV_KERNEL_ADDR_RAM) "\0" \
+ "mv_initrd_addr=" MK_STR(MV_INITRD_ADDR) "\0" \
+ "mv_initrd_addr_ram=" MK_STR(MV_INITRD_ADDR_RAM) "\0" \
+ "mv_initrd_length=" MK_STR(MV_INITRD_LENGTH) "\0" \
+ "mv_dtb_addr=" MK_STR(MV_DTB_ADDR) "\0" \
+ "mv_dtb_addr_ram=" MK_STR(MV_DTB_ADDR_RAM) "\0" \
+ "dtb_name=" MK_STR(MV_DTB_NAME) "\0" \
"mv_version=" U_BOOT_VERSION "\0" \
- "dhcp_client_id=" MV_CI "\0" \
- "dhcp_vendor-class-identifier=" MV_VCI "\0" \
+ "dhcp_client_id=" MK_STR(MV_CI) "\0" \
+ "dhcp_vendor-class-identifier=" MK_STR(MV_VCI) "\0" \
"netretry=no\0" \
"use_static_ipaddr=no\0" \
"static_ipaddr=192.168.90.10\0" \
@@ -470,6 +471,7 @@
"gevss_debug=0\0" \
"watchdog=0\0" \
"usb_dr_mode=host\0" \
+ "sensor_cnt=2\0" \
""
#define CONFIG_FPGA_COUNT 1
2
1
Hello, I am a first time poster so here goes:
u-boot 1.3.1 rc2 (I checked the code in 1.3.4 rc2 and it is still
there)
The problem is that when enumeration is taking place when a bridge is
discovered it goes through pciauto_prescan_setup_bridge() which takes
the current bus_lower value from the region struct and places it in the
bridge pci_memory_base register. The next process is to scan behind the
bridge and then to go through pciauto_postscan_setup_bridge() to figure
out what needs to be put into the pci_memory_limit register.
However, the algorithm for setting the limit register does not take into
account that if nothing is found behind the bridge requiring memory then
bus_lower has not changed, thus when it sets the register to bus_lower -
1 this makes the limit register less than the base register.
I am able to duplicate this rather easily on our ATCA carrier with 8347
processor connected to a PLX 8111 pci2pcie bridge that in turn is
connected to a PLX 8524 PCIe switch that connects to our 4 PCIe x4 AMC
slots. I only populate the first AMC slot with a card that requires 8MB
of space and after u-boot enumeration you cannot display the memory at
the address from the AMC's BAR register. This is because the other
bridge segments have all programmed the limit registers incorrectly. I
put code in that checks to see if anything is behind the bridge with
memory and if not then zero out the base and limit registers otherwise
use the bus_lower - 1 value and everything works.
So, here are the changes I did here local and am thinking that if this
looks ok, then I will also need to add this to the pre-fetch logic as
well.
void pciauto_postscan_setup_bridge(struct pci_controller *hose,
pci_dev_t dev, int sub_bus)
{
struct pci_region *pci_mem = hose->pci_mem;
struct pci_region *pci_prefetch = hose->pci_prefetch;
struct pci_region *pci_io = hose->pci_io;
unsigned int bridge_mem_base = 0;
/* Configure bus number registers */
pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS,
sub_bus - hose->first_busno);
if (pci_mem) {
/* Round memory allocator to 1MB boundary */
pciauto_region_align(pci_mem, 0x100000);
+ /* danny, 15aug08
+ * read the the bus_lower value that was placed in the
+ * PCI_MEMORY_BASE register during pciauto_prescan_setup_bridge
+ * and check to see if anything behind it consumed memory
+ */
+ pci_hose_read_config_word(hose, dev, PCI_MEMORY_BASE,
&bridge_mem_base)
;
+
+ if((bridge_mem_base >> 16) == ((pci_mem->bus_lower &
0xfff00000) >> 16)
) {
+ /* danny, 15aug08
+ * since no memory was allocated behind this bridge
+ * then don't try to program the base and limit
+ * otherwise the -1 will make the upper limit value
+ * less than the base causing memory routing problems
+ */
+ pci_hose_write_config_dword(hose, dev, PCI_MEMORY_BASE, 0);
+ } else {
+ /* danny, 15aug08
+ * else set the limit -1 behind the next address
+ * boundry
+ */
+ pci_hose_write_config_word(hose, dev, PCI_MEMORY_LIMIT,
+ (pci_mem->bus_lower - 1) >> 16);
+ }
+ }
void pciauto_postscan_setup_bridge(struct pci_controller *hose,
pci_dev_t dev, int sub_bus)
{
struct pci_region *pci_mem = hose->pci_mem;
struct pci_region *pci_prefetch = hose->pci_prefetch;
struct pci_region *pci_io = hose->pci_io;
/* Configure bus number registers */
pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS,
sub_bus - hose->first_busno);
if (pci_mem) {
/* Round memory allocator to 1MB boundary */
pciauto_region_align(pci_mem, 0x100000);
- pci_hose_write_config_word(hose, dev, PCI_MEMORY_LIMIT,
(pci_mem->bus_lower-1) >> 16);
}
------------------------------------------------------
Interphase - Designed to Perform, Designed to Last (R)
Danny Waldron - Technical Support
Phone - 214.654.5244
------------------------------------------------------
Disc Golf - the wind is my friend...or....every putt is an adventure for
this Texas Chain Ranger!
2
2
As for mpc85xx cpu,It seems bootflag parametor in board_init_f does not work
correctly,anyone ever experienced the same issue?
I am using u-boot-1.3.2,No matter execute power-on or hard reset via
MSR[DE],DBCR0[IDM],always get wrong bootflag value.
Is there any other ways to differentiate cold reboot and warm reboot for
mpc85xx series?
Thanks in advance!
--
View this message in context: http://www.nabble.com/bootflag-for-mpc85xx-cpu--tp19046711p19046711.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
2
1