Re: [U-Boot] stuck after redirecting stdout to nc

2012-01-06 Thread Ran Shalit
On Fri, Jan 6, 2012 at 1:26 AM, Mike Frysinger vap...@gentoo.org wrote:

 On Monday 02 January 2012 09:50:42 ran shalit wrote:
  On uboot loading, I checking a specific environement (called
 consoleddev),
  to decide to rediect console to nc or staying in serial.
  I then see some strange behaviour:
  if the environment tell uboot to redirect to net console, everything
 works
  well, but only if the ethernet cable is connected. if it is not connected
  then I see that the kernel is not loading.

 there could easily be a bug where netconsole does not work if the network
 is
 not available.  patches welcome to add timeouts.
 -mike

Do you think such bug is independent of architecture type ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/4] OMAP3+: Clock: Adding ehci clock enabling

2012-01-06 Thread Govindraj.R
From: Govindraj.R govindraj.r...@ti.com

Adding ehci clock enabling mechanism part of clock framework.
When essential clocks are enabled during init phase usb host
clocks can also be enabled from clock framework.

Signed-off-by: Govindraj.R govindraj.r...@ti.com
---
 arch/arm/cpu/armv7/omap3/board.c|4 
 arch/arm/cpu/armv7/omap3/clock.c|   20 
 arch/arm/cpu/armv7/omap4/clocks.c   |5 +
 arch/arm/include/asm/arch-omap3/sys_proto.h |1 +
 4 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c
index 1f33c63..d3b25cd 100644
--- a/arch/arm/cpu/armv7/omap3/board.c
+++ b/arch/arm/cpu/armv7/omap3/board.c
@@ -228,6 +228,10 @@ void s_init(void)
 
per_clocks_enable();
 
+#ifdef CONFIG_USB_EHCI_OMAP
+   ehci_clocks_enable();
+#endif
+
 #ifdef CONFIG_SPL_BUILD
preloader_console_init();
 #endif
diff --git a/arch/arm/cpu/armv7/omap3/clock.c b/arch/arm/cpu/armv7/omap3/clock.c
index e0d65c7..567817e 100644
--- a/arch/arm/cpu/armv7/omap3/clock.c
+++ b/arch/arm/cpu/armv7/omap3/clock.c
@@ -626,6 +626,26 @@ void prcm_init(void)
sdelay(5000);
 }
 
+/*
+ * Enable usb ehci uhh, tll clocks
+ */
+void ehci_clocks_enable(void)
+{
+   struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+
+   /* Enable USBHOST_L3_ICLK (USBHOST_MICLK) */
+   sr32(prcm_base-iclken_usbhost, 0, 1, 1);
+   /*
+* Enable USBHOST_48M_FCLK (USBHOST_FCLK1)
+* and USBHOST_120M_FCLK (USBHOST_FCLK2)
+*/
+   sr32(prcm_base-fclken_usbhost, 0, 2, 3);
+   /* Enable USBTTL_ICLK */
+   sr32(prcm_base-iclken3_core, 2, 1, 1);
+   /* Enable USBTTL_FCLK */
+   sr32(prcm_base-fclken3_core, 2, 1, 1);
+}
+
 /**
  * peripheral_enable() - Enable the clks  power for perifs (GPT2, UART1,...)
  */
diff --git a/arch/arm/cpu/armv7/omap4/clocks.c 
b/arch/arm/cpu/armv7/omap4/clocks.c
index 0886f92..12e283a 100644
--- a/arch/arm/cpu/armv7/omap4/clocks.c
+++ b/arch/arm/cpu/armv7/omap4/clocks.c
@@ -342,6 +342,9 @@ void enable_basic_clocks(void)
prcm-cm_l4per_gpio4_clkctrl,
prcm-cm_l4per_gpio5_clkctrl,
prcm-cm_l4per_gpio6_clkctrl,
+   prcm-cm_l3init_usbphy_clkctrl,
+   prcm-cm_clksel_usb_60mhz,
+   prcm-cm_l3init_hsusbtll_clkctrl,
0
};
 
@@ -352,6 +355,8 @@ void enable_basic_clocks(void)
prcm-cm_l4per_gptimer2_clkctrl,
prcm-cm_wkup_wdtimer2_clkctrl,
prcm-cm_l4per_uart3_clkctrl,
+   prcm-cm_l3init_fsusb_clkctrl,
+   prcm-cm_l3init_hsusbhost_clkctrl,
0
};
 
diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h 
b/arch/arm/include/asm/arch-omap3/sys_proto.h
index e5031d5..2a89e56 100644
--- a/arch/arm/include/asm/arch-omap3/sys_proto.h
+++ b/arch/arm/include/asm/arch-omap3/sys_proto.h
@@ -34,6 +34,7 @@ struct emu_hal_params {
 
 void prcm_init(void);
 void per_clocks_enable(void);
+void ehci_clocks_enable(void);
 
 void memif_init(void);
 void sdrc_init(void);
-- 
1.7.5.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/4] OMAP4: clock-common: Move the usb dppl configuration to new func

2012-01-06 Thread Govindraj.R
From: Govindraj.R govindraj.r...@ti.com

usb dpll configuration is done only part of non-essential
dppl configuration however if CONFIG_USB_EHCI_OMAP is defined
we may have to configure usb dpll's for proper functioning
of usb modules. So move the usb dppl configuration to a new func.
and utilise the same during essential dpll configuration.

Signed-off-by: Govindraj.R govindraj.r...@ti.com
---
 arch/arm/cpu/armv7/omap-common/clocks-common.c |   52 ++-
 1 files changed, 32 insertions(+), 20 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap-common/clocks-common.c 
b/arch/arm/cpu/armv7/omap-common/clocks-common.c
index 1da90a4..770ac19 100644
--- a/arch/arm/cpu/armv7/omap-common/clocks-common.c
+++ b/arch/arm/cpu/armv7/omap-common/clocks-common.c
@@ -251,6 +251,33 @@ void configure_mpu_dpll(void)
debug(MPU DPLL locked\n);
 }
 
+static void setup_usb_dpll(void)
+{
+   const struct dpll_params *params;
+   u32 sys_clk_khz, sd_div, num, den;
+
+   sys_clk_khz = get_sys_clk_freq() / 1000;
+   /*
+* USB:
+* USB dpll is J-type. Need to set DPLL_SD_DIV for jitter correction
+* DPLL_SD_DIV = CEILING ([DPLL_MULT/(DPLL_DIV+1)]* CLKINP / 250)
+*  - where CLKINP is sys_clk in MHz
+* Use CLKINP in KHz and adjust the denominator accordingly so
+* that we have enough accuracy and at the same time no overflow
+*/
+   params = get_usb_dpll_params();
+   num = params-m * sys_clk_khz;
+   den = (params-n + 1) * 250 * 1000;
+   num += den - 1;
+   sd_div = num / den;
+   clrsetbits_le32(prcm-cm_clksel_dpll_usb,
+   CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK,
+   sd_div  CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT);
+
+   /* Now setup the dpll with the regular function */
+   do_setup_dpll(prcm-cm_clkmode_dpll_usb, params, DPLL_LOCK, usb);
+}
+
 static void setup_dplls(void)
 {
u32 temp;
@@ -282,13 +309,16 @@ static void setup_dplls(void)
 
/* MPU dpll */
configure_mpu_dpll();
+
+#ifdef CONFIG_USB_EHCI_OMAP
+   setup_usb_dpll();
+#endif
 }
 
 #ifdef CONFIG_SYS_CLOCKS_ENABLE_ALL
 static void setup_non_essential_dplls(void)
 {
u32 sys_clk_khz, abe_ref_clk;
-   u32 sd_div, num, den;
const struct dpll_params *params;
 
sys_clk_khz = get_sys_clk_freq() / 1000;
@@ -300,25 +330,7 @@ static void setup_non_essential_dplls(void)
params = get_iva_dpll_params();
do_setup_dpll(prcm-cm_clkmode_dpll_iva, params, DPLL_LOCK, iva);
 
-   /*
-* USB:
-* USB dpll is J-type. Need to set DPLL_SD_DIV for jitter correction
-* DPLL_SD_DIV = CEILING ([DPLL_MULT/(DPLL_DIV+1)]* CLKINP / 250)
-*  - where CLKINP is sys_clk in MHz
-* Use CLKINP in KHz and adjust the denominator accordingly so
-* that we have enough accuracy and at the same time no overflow
-*/
-   params = get_usb_dpll_params();
-   num = params-m * sys_clk_khz;
-   den = (params-n + 1) * 250 * 1000;
-   num += den - 1;
-   sd_div = num / den;
-   clrsetbits_le32(prcm-cm_clksel_dpll_usb,
-   CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK,
-   sd_div  CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT);
-
-   /* Now setup the dpll with the regular function */
-   do_setup_dpll(prcm-cm_clkmode_dpll_usb, params, DPLL_LOCK, usb);
+   setup_usb_dpll();
 
/* Configure ABE dpll */
params = get_abe_dpll_params();
-- 
1.7.5.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 0/4] Clean up ehci-omap and extend support for omap3/4 socs

2012-01-06 Thread Govindraj.R
From: Govindraj.R govindraj.r...@ti.com

Clean up ehci-omap added and make it generic to extend support for omap4 socs.
Add ehci support for panda board.

Patch series depends on below patch:
http://patchwork.ozlabs.org/patch/130952/

Patch series based commit id:
9a4209869bd2c37affd931d627b3c3e72952

This patch series long with above dependent patch is avialable at:
git://gitorious.org/denx_u-boot/denx_uboot_omap.git
v2_ehci_omap4

Fatls, ping and tftp was tested with this patch series.
Test log for Panda available here:
http://pastebin.pandaboard.org/index.php/view/55361716
Test log for Beagle-XM available here:
http://pastebin.pandaboard.org/index.php/view/98437825  

Changes from v1:
---
* v1 was adding ehci-omap.c
  Now I have rebased my patch on top of Ilya Yanok's Patch
  http://patchwork.ozlabs.org/patch/130952/
* Fixed Tom Rini's Comments as in below thread.
  http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/120430
  http://patchwork.ozlabs.org/patch/131367/

Govindraj.R (4):
  ehci-omap: Clean up added ehci-omap.c
  OMAP3+: Clock: Adding ehci clock enabling
  OMAP4: clock-common: Move the usb dppl configuration to new func
  OMAP3+: ehci-omap: enable usb host ports for beagle/panda

 arch/arm/cpu/armv7/omap-common/clocks-common.c |   52 --
 arch/arm/cpu/armv7/omap3/board.c   |4 +
 arch/arm/cpu/armv7/omap3/clock.c   |   20 ++
 arch/arm/cpu/armv7/omap4/clocks.c  |5 +
 arch/arm/include/asm/arch-omap3/ehci.h |   55 ++
 arch/arm/include/asm/arch-omap3/ehci_omap3.h   |   58 --
 arch/arm/include/asm/arch-omap3/sys_proto.h|1 +
 arch/arm/include/asm/arch-omap4/ehci.h |   49 +
 arch/arm/include/asm/ehci-omap.h   |  147 +++
 board/ti/beagle/beagle.c   |   28 +++
 board/ti/panda/panda.c |   41 +
 board/ti/panda/panda_mux_data.h|   16 +-
 drivers/usb/host/ehci-omap.c   |  228 ++--
 include/configs/omap4_panda.h  |   23 +++-
 14 files changed, 584 insertions(+), 143 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap3/ehci.h
 delete mode 100644 arch/arm/include/asm/arch-omap3/ehci_omap3.h
 create mode 100644 arch/arm/include/asm/arch-omap4/ehci.h
 create mode 100644 arch/arm/include/asm/ehci-omap.h

-- 
1.7.5.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/4] ehci-omap: Clean up added ehci-omap.c

2012-01-06 Thread Govindraj.R
From: Govindraj.R govindraj.r...@ti.com

Clean up added ehci-omap.c and make it generic for re-use across
soc having same ehci ip block. Also pass the modes to be configured
and configure the ports accordingly. All usb layers are not cache
aligned till then keep cache off for usb ops as ehci will use
internally dma for all usb ops.

* Add a generic common header ehci-omap.h having common ip block
  data and reg shifts.
* Rename and modify ehci-omap3 to ehci.h retain only conflicting
  sysc reg shifts remove others and move to common header file.

Signed-off-by: Govindraj.R govindraj.r...@ti.com
---
 arch/arm/include/asm/arch-omap3/ehci.h   |   55 ++
 arch/arm/include/asm/arch-omap3/ehci_omap3.h |   58 ---
 arch/arm/include/asm/arch-omap4/ehci.h   |   49 ++
 arch/arm/include/asm/ehci-omap.h |  147 +
 drivers/usb/host/ehci-omap.c |  228 +++---
 5 files changed, 423 insertions(+), 114 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-omap3/ehci.h
 delete mode 100644 arch/arm/include/asm/arch-omap3/ehci_omap3.h
 create mode 100644 arch/arm/include/asm/arch-omap4/ehci.h
 create mode 100644 arch/arm/include/asm/ehci-omap.h

diff --git a/arch/arm/include/asm/arch-omap3/ehci.h 
b/arch/arm/include/asm/arch-omap3/ehci.h
new file mode 100644
index 000..d622363
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap3/ehci.h
@@ -0,0 +1,55 @@
+/*
+ * (C) Copyright 2011
+ * Alexander Holler hol...@ahsoftware.de
+ *
+ * Based on drivers/usb/host/ehci-omap.c from Linux 2.6.37
+ *
+ * See there for additional Copyrights.
+ *
+ * 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., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+#ifndef _EHCI_H_
+#define _EHCI_H_
+
+/* USB/EHCI registers */
+#define OMAP_USBTLL_BASE   0x48062000UL
+#define OMAP_UHH_BASE  0x48064000UL
+#define OMAP_EHCI_BASE 0x48064800UL
+
+/* TLL Register Set */
+#define OMAP_USBTLL_SYSCONFIG_SOFTRESET(1  1)
+#define OMAP_USBTLL_SYSCONFIG_ENAWAKEUP(1  2)
+#define OMAP_USBTLL_SYSCONFIG_SIDLEMODE(1  3)
+#define OMAP_USBTLL_SYSCONFIG_CACTIVITY(1  8)
+#define OMAP_USBTLL_SYSSTATUS_RESETDONE1
+
+/* UHH Register Set */
+#define OMAP_UHH_SYSCONFIG_SOFTRESET   (1  1)
+#define OMAP_UHH_SYSCONFIG_CACTIVITY   (1  8)
+#define OMAP_UHH_SYSCONFIG_SIDLEMODE   (1  3)
+#define OMAP_UHH_SYSCONFIG_ENAWAKEUP   (1  2)
+#define OMAP_UHH_SYSCONFIG_MIDLEMODE   (1  12)
+#define OMAP_UHH_SYSSTATUS_EHCI_RESETDONE  (1  2)
+
+#define OMAP_UHH_SYSCONFIG_VAL (OMAP_UHH_SYSCONFIG_CACTIVITY | \
+   OMAP_UHH_SYSCONFIG_SIDLEMODE | \
+   OMAP_UHH_SYSCONFIG_ENAWAKEUP | \
+   OMAP_UHH_SYSCONFIG_MIDLEMODE)
+
+#endif /* _EHCI_H_ */
diff --git a/arch/arm/include/asm/arch-omap3/ehci_omap3.h 
b/arch/arm/include/asm/arch-omap3/ehci_omap3.h
deleted file mode 100644
index cd01f50..000
--- a/arch/arm/include/asm/arch-omap3/ehci_omap3.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * (C) Copyright 2011
- * Alexander Holler hol...@ahsoftware.de
- *
- * Based on drivers/usb/host/ehci-omap.c from Linux 2.6.37
- *
- * See there for additional Copyrights.
- *
- * 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., 51 Franklin 

[U-Boot] [PATCH v2 4/4] OMAP3+: ehci-omap: enable usb host ports for beagle/panda

2012-01-06 Thread Govindraj.R
From: Govindraj.R govindraj.r...@ti.com

For beagle and panda enable and use the ehci-omap.c generic
api's added to configure usb host ports based on data passed
from board file to configure in modes as specified from board data.
For panda initialise the mux pins for ehci usage.

Signed-off-by: Govindraj.R govindraj.r...@ti.com
---
 board/ti/beagle/beagle.c|   28 ++
 board/ti/panda/panda.c  |   41 +++
 board/ti/panda/panda_mux_data.h |   16 +++---
 include/configs/omap4_panda.h   |   23 -
 4 files changed, 99 insertions(+), 9 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 3d63028..2f2e8ba 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -45,6 +45,11 @@
 #include beagle.h
 #include command.h
 
+#ifdef CONFIG_USB_EHCI
+#include usb.h
+#include asm/ehci-omap.h
+#endif
+
 #define pr_debug(fmt, args...) debug(fmt, ##args)
 
 #define TWL4030_I2C_BUS0
@@ -438,6 +443,29 @@ void show_boot_progress(int val)
if(val == 15)
usb_stop();
 }
+
+static struct omap_usbhs_board_data usbhs_bdata = {
+   .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+   .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+   .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED
+};
+
+int ehci_hcd_init(void)
+{
+   int ret = 0;
+
+   ret = omap_ehci_hcd_init(usbhs_bdata);
+   return ret;
+}
+
+int ehci_hcd_stop(void)
+{
+   int ret;
+
+   ret = omap_ehci_hcd_stop();
+   return ret;
+}
+
 #endif /* CONFIG_USB_EHCI */
 
 #ifndef CONFIG_SPL_BUILD
diff --git a/board/ti/panda/panda.c b/board/ti/panda/panda.c
index fc8c0b4..1f8509b 100644
--- a/board/ti/panda/panda.c
+++ b/board/ti/panda/panda.c
@@ -26,9 +26,16 @@
 #include asm/arch/mmc_host_def.h
 #include asm/arch/clocks.h
 #include asm/arch/gpio.h
+#include asm/gpio.h
 
 #include panda_mux_data.h
 
+#ifdef CONFIG_USB_EHCI
+#include usb.h
+#include asm/arch/ehci.h
+#include asm/ehci-omap.h
+#endif
+
 #define PANDA_ULPI_PHY_TYPE_GPIO   182
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -177,6 +184,40 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_USB_EHCI
+
+static struct omap_usbhs_board_data usbhs_bdata = {
+   .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
+   .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
+   .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
+};
+
+int ehci_hcd_init(void)
+{
+   int ret;
+   unsigned int utmi_clk;
+
+   /* Now we can enable our port clocks */
+   utmi_clk = readl((void *)CM_L3INIT_HSUSBHOST_CLKCTRL);
+   utmi_clk |= HSUSBHOST_CLKCTRL_CLKSEL_UTMI_P1_MASK;
+   sr32((void *)CM_L3INIT_HSUSBHOST_CLKCTRL, 0, 32, utmi_clk);
+
+   ret = omap_ehci_hcd_init(usbhs_bdata);
+   if (ret  0)
+   return ret;
+
+   return 0;
+}
+
+int ehci_hcd_stop(void)
+{
+   int ret;
+
+   ret = omap_ehci_hcd_stop();
+   return ret;
+}
+#endif
+
 /*
  * get_board_rev() - get board revision
  */
diff --git a/board/ti/panda/panda_mux_data.h b/board/ti/panda/panda_mux_data.h
index 2970ccd..5b66a14 100644
--- a/board/ti/panda/panda_mux_data.h
+++ b/board/ti/panda/panda_mux_data.h
@@ -136,14 +136,14 @@ const struct pad_conf_entry 
core_padconf_array_non_essential[] = {
{CAM_SHUTTER, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)},/* 
cam_shutter */
{CAM_STROBE, (OFF_EN | OFF_PD | OFF_OUT_PTD | M0)}, /* 
cam_strobe */
{CAM_GLOBALRESET, (PTD | OFF_EN | OFF_PD | OFF_OUT_PTD | M3)},  /* 
gpio_83 */
-   {USBB1_ULPITLL_CLK, (IEN | OFF_EN | OFF_IN | M1)},  /* 
hsi1_cawake */
-   {USBB1_ULPITLL_STP, (IEN | OFF_EN | OFF_IN | M1)},  /* 
hsi1_cadata */
-   {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_IN | M1)},  /* 
hsi1_caflag */
-   {USBB1_ULPITLL_NXT, (OFF_EN | M1)}, /* 
hsi1_acready */
-   {USBB1_ULPITLL_DAT0, (OFF_EN | M1)},/* 
hsi1_acwake */
-   {USBB1_ULPITLL_DAT1, (OFF_EN | M1)},/* 
hsi1_acdata */
-   {USBB1_ULPITLL_DAT2, (OFF_EN | M1)},/* 
hsi1_acflag */
-   {USBB1_ULPITLL_DAT3, (IEN | OFF_EN | OFF_IN | M1)}, /* 
hsi1_caready */
+   {USBB1_ULPITLL_CLK, (PTD | IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* 
usbb1_ulpiphy_clk */
+   {USBB1_ULPITLL_STP, (OFF_EN | OFF_OUT_PTD | M4)},   /* 
usbb1_ulpiphy_stp */
+   {USBB1_ULPITLL_DIR, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* 
usbb1_ulpiphy_dir */
+   {USBB1_ULPITLL_NXT, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)}, /* 
usbb1_ulpiphy_nxt */
+   {USBB1_ULPITLL_DAT0, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* 
usbb1_ulpiphy_dat0 */
+   {USBB1_ULPITLL_DAT1, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* 
usbb1_ulpiphy_dat1 */
+   {USBB1_ULPITLL_DAT2, (IEN | OFF_EN | OFF_PD | OFF_IN | M4)},/* 
usbb1_ulpiphy_dat2 */

Re: [U-Boot] Regarding HUSH support in uboot

2012-01-06 Thread Wolfgang Denk
Dear amruth vamadev,

In message cal5dgcruo3ayzjtdoqbgszd6-d4kagso7bfvsnphyajx3lm...@mail.gmail.com 
you wrote:
 How do we know whether hush shell capability is supported or not in
 the command shell.I have enabled CONFIG_SYS_HUSH_PARSER in in config
 file.

A simple test is

echo a  echo b

If you get a  echo b back, then hush is not active.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The one who says it cannot be done should never interrupt the one who
is doing it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stuck after redirecting stdout to nc

2012-01-06 Thread Wolfgang Denk
Dear Ran Shalit,

In message 
CAJ2oMhKLcdT_NFjbfcJ4O7kGz+B-TK93MWynb4=F02iLnBB=s...@mail.gmail.com you 
wrote:

 Do you think such bug is independent of architecture type ?

This is impossible to say without knowing where and what the bug is.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Cogito cogito ergo cogito sum - I think that I  think,  therefore  I
think that I am.  - Ambrose Bierce, The Devil's Dictionary
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Revert common.h: remove value from bool defines

2012-01-06 Thread Wolfgang Denk
This reverts commit 914c9ee971924665c9d2927fe83d8d70060b1eb8
which is causing tons of build warnings like
start.S:39:0: warning: _LINUX_CONFIG_H redefined [enabled by
default]
/home/wd/git/u-boot/work/include/common.h:28:0: note: this is the
location of the previous definition
/work/wd/tmp-ppc/nand_spl/board/freescale/mpc8315erdb/start.S:39:0:
warning: _LINUX_CONFIG_H redefined [enabled by default]
/home/wd/git/u-boot/work/include/common.h:28:0: note: this is the
location of the previous definition
etc.

Signed-off-by: Wolfgang Denk w...@denx.de
---
 include/common.h |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/include/common.h b/include/common.h
index 59e0b00..3df1def 100644
--- a/include/common.h
+++ b/include/common.h
@@ -22,10 +22,10 @@
  */
 
 #ifndef __COMMON_H_
-#define __COMMON_H_
+#define __COMMON_H_1
 
 #undef _LINUX_CONFIG_H
-#define _LINUX_CONFIG_H/* avoid reading Linux autoconf.h file  
*/
+#define _LINUX_CONFIG_H 1  /* avoid reading Linux autoconf.h file  */
 
 #ifndef __ASSEMBLY__   /* put C only stuff in this section */
 
@@ -51,18 +51,18 @@ typedef volatile unsigned char  vu_char;
 defined(CONFIG_MPC859DSL)  || \
 defined(CONFIG_MPC866) || defined(CONFIG_MPC866T)  || \
 defined(CONFIG_MPC866P)
-# define CONFIG_MPC866_FAMILY
+# define CONFIG_MPC866_FAMILY 1
 #elif defined(CONFIG_MPC870) \
|| defined(CONFIG_MPC875) \
|| defined(CONFIG_MPC880) \
|| defined(CONFIG_MPC885)
-# define CONFIG_MPC885_FAMILY
+# define CONFIG_MPC885_FAMILY   1
 #endif
 #if   defined(CONFIG_MPC860)  \
|| defined(CONFIG_MPC860T) \
|| defined(CONFIG_MPC866_FAMILY) \
|| defined(CONFIG_MPC885_FAMILY)
-# define CONFIG_MPC86x
+# define CONFIG_MPC86x 1
 #endif
 #elif defined(CONFIG_5xx)
 #include asm/5xx_immap.h
@@ -77,10 +77,10 @@ typedef volatile unsigned char  vu_char;
|| defined(CONFIG_MPC8248) \
|| defined(CONFIG_MPC8271) \
|| defined(CONFIG_MPC8272)
-#define CONFIG_MPC8272_FAMILY
+#define CONFIG_MPC8272_FAMILY  1
 #endif
 #if defined(CONFIG_MPC8272_FAMILY)
-#define CONFIG_MPC8260
+#define CONFIG_MPC8260 1
 #endif
 #include asm/immap_8260.h
 #endif
@@ -200,7 +200,7 @@ typedef void (interrupt_handler_t)(void *);
  || defined(CONFIG_8xx_CONS_SCC1) || defined(CONFIG_8xx_CONS_SCC2) \
  || defined(CONFIG_8xx_CONS_SCC3) || defined(CONFIG_8xx_CONS_SCC4)
 
-#define CONFIG_SERIAL_MULTI
+#define CONFIG_SERIAL_MULTI1
 
 #endif
 
-- 
1.7.7.5

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stuck after redirecting stdout to nc

2012-01-06 Thread Ran Shalit
On Fri, Jan 6, 2012 at 11:18 AM, Wolfgang Denk w...@denx.de wrote:

 Dear Ran Shalit,

 In message CAJ2oMhKLcdT_NFjbfcJ4O7kGz+B-TK93MWynb4=F02iLnBB=
 s...@mail.gmail.com you wrote:
 
  Do you think such bug is independent of architecture type ?

 This is impossible to say without knowing where and what the bug is.

 Best regards,

 Wolfgang Denk


 You're right.
What I did see in my tests is as follows:
1. only if there is connection to PC and the PC's interface ip is the same
as the ncip environement, then and only then, I see that the u-boot finish
its job and starts the bootcmd, and loading the kernel. I also see the
u-boot prints in the ethernet if I start netconsole, but event without
starting netconsole, the kernel starts (as expected)
2. Otherwise, if the network interface ip is not the same as ncip, or cable
is disconnected the u-boot does not start bootcmd, and I actually do not
know where it stoped and why.

Please tell me if you have any advice where to look, and what should be
checked,

Best Regards,
Ran
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] add nand spl boot for qi_lb60 board

2012-01-06 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu xian...@openmobilefree.net
---
 arch/mips/cpu/xburst/cpu.c   |4 +
 arch/mips/cpu/xburst/start_spl.S |   65 
 drivers/mtd/nand/jz4740_nand.c   |   40 +++-
 include/configs/qi_lb60.h|3 +
 nand_spl/board/qi/qi_lb60/Makefile   |  112 ++
 nand_spl/board/qi/qi_lb60/nand_spl.c |   37 +++
 nand_spl/board/qi/qi_lb60/u-boot.lds |   63 +++
 7 files changed, 321 insertions(+), 3 deletions(-)
 create mode 100644 arch/mips/cpu/xburst/start_spl.S
 create mode 100644 nand_spl/board/qi/qi_lb60/Makefile
 create mode 100644 nand_spl/board/qi/qi_lb60/nand_spl.c
 create mode 100644 nand_spl/board/qi/qi_lb60/u-boot.lds

diff --git a/arch/mips/cpu/xburst/cpu.c b/arch/mips/cpu/xburst/cpu.c
index e976341..afd166c 100644
--- a/arch/mips/cpu/xburst/cpu.c
+++ b/arch/mips/cpu/xburst/cpu.c
@@ -42,6 +42,8 @@
:   \
: i (op), R (*(unsigned char *)(addr)))
 
+#ifndef CONFIG_NAND_SPL
+
 void __attribute__((weak)) _machine_restart(void)
 {
struct jz4740_wdt *wdt = (struct jz4740_wdt *)JZ4740_WDT_BASE;
@@ -109,6 +111,8 @@ void invalidate_dcache_range(ulong start_addr, ulong stop)
cache_op(Hit_Invalidate_D, addr);
 }
 
+#endif
+
 void flush_icache_all(void)
 {
u32 addr, t = 0;
diff --git a/arch/mips/cpu/xburst/start_spl.S b/arch/mips/cpu/xburst/start_spl.S
new file mode 100644
index 000..f137ccd
--- /dev/null
+++ b/arch/mips/cpu/xburst/start_spl.S
@@ -0,0 +1,65 @@
+/*
+ *  Startup Code for MIPS32 XBURST CPU-core
+ *
+ *  Copyright (c) 2010 Xiangfu Liu xian...@sharism.cc
+ *
+ * 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 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include config.h
+#include version.h
+#include asm/regdef.h
+#include asm/mipsregs.h
+#include asm/addrspace.h
+#include asm/cacheops.h
+
+#include asm/jz4740.h
+
+   .set noreorder
+
+   .globl _start
+   .text
+_start:
+   .word JZ4740_NANDBOOT_CFG /* fetched during NAND Boot */
+reset:
+   /*
+* STATUS register
+* CU0=UM=EXL=IE=0, BEV=ERL=1, IP2~7=1
+*/
+   li  t0, 0x0040FC04
+   mtc0t0, CP0_STATUS
+   /*
+* CAUSE register
+* IV=1, use the specical interrupt vector (0x200)
+*/
+   li  t1, 0x0080
+   mtc0t1, CP0_CAUSE
+
+   bal 1f
+nop
+   .word   _GLOBAL_OFFSET_TABLE_
+1:
+   movegp, ra
+   lw  t1, 0(ra)
+   movegp, t1
+
+   la  sp, 0x80004000
+   la  t9, nand_spl_boot
+   j   t9
+nop
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index 3ec34f3..7ef07a5 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -15,6 +15,10 @@
 #include asm/io.h
 #include asm/jz4740.h
 
+#ifdef CONFIG_NAND_SPL
+  #define printf(arg...) do {} while (0)
+#endif
+
 #define JZ_NAND_DATA_ADDR ((void __iomem *)0xB800)
 #define JZ_NAND_CMD_ADDR (JZ_NAND_DATA_ADDR + 0x8000)
 #define JZ_NAND_ADDR_ADDR (JZ_NAND_DATA_ADDR + 0x1)
@@ -176,7 +180,7 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, 
u_char *dat,
for (k = 0; k  9; k++)
writeb(read_ecc[k], emc-nfpar[k]);
}
-   /* Set PRDY */
+
writel(readl(emc-nfecr) | EMC_NFECR_PRDY, emc-nfecr);
 
/* Wait for completion */
@@ -184,7 +188,7 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, 
u_char *dat,
status = readl(emc-nfints);
} while (!(status  EMC_NFINTS_DECF));
 
-   /* disable ecc */
+   /* Disable ECC */
writel(readl(emc-nfecr)  ~EMC_NFECR_ECCE, emc-nfecr);
 
/* Check decoding */
@@ -192,7 +196,7 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, 
u_char *dat,
return 0;
 
if (status  EMC_NFINTS_UNCOR) {
-   printf(uncorrectable ecc\n);
+   printf(JZ4740 uncorrectable ECC\n);
return -1;
}
 
@@ -230,6 +234,32 @@ static int jz_nand_rs_correct_data(struct mtd_info *mtd, 
u_char *dat,
return errcnt;
 }
 
+#ifdef CONFIG_NAND_SPL
+void nand_read_buf(struct 

Re: [U-Boot] add nand spl boot for qi_lb60 board

2012-01-06 Thread Xiangfu Liu

On 01/06/2012 02:44 AM, Scott Wood wrote:

Use mips-whatever-objdump -dlrsh on the good and bad u-boot binaries
(or on any .o files you suspect may be relevant), to see more
specifically what's different.

You may also want to try compiling suspect files to assembly and
comparing the differences there.

-Scott


thanks Scott. a working patch is coming soon.

forget add CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST to board configure head file.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Regarding HUSH support in uboot

2012-01-06 Thread amruth vamadev
Wolfgang Denk
Thanks for response.If I want to store those strings into variable and
may be compare it or parse it for information.For example echo a
redirected to variable like assignment. My goal is to write simple
diags to test pci or serial flash using commands in the shell using
script. We can issue the commands and parse the response and print
useful messages to users.
myvar = echo a
if itest.s myvar == a
then echo 'a
else echo no a
Any idea how we can achieve this.
Thanks
Amruth p.v


On Fri, Jan 6, 2012 at 2:47 PM, Wolfgang Denk w...@denx.de wrote:
 Dear amruth vamadev,

 In message 
 cal5dgcruo3ayzjtdoqbgszd6-d4kagso7bfvsnphyajx3lm...@mail.gmail.com you 
 wrote:
 How do we know whether hush shell capability is supported or not in
 the command shell.I have enabled CONFIG_SYS_HUSH_PARSER in in config
 file.

 A simple test is

        echo a  echo b

 If you get a  echo b back, then hush is not active.

 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH,     MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 The one who says it cannot be done should never interrupt the one who
 is doing it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Secure update of uboot devices?

2012-01-06 Thread Andreas Bäck
Actually there seams to exsist some very old patches for this
http://lists.denx.de/pipermail/u-boot/2006-September/016960.html

Here a paper quite exact what I am after:
http://elinux.org/images/2/28/Trusted_Boot_Loader.pdf

Is there any toughts on integating this in trunk or should I try to merge
this patch with the git trunk of my own?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-06 Thread Chander Kashyap
Dear Wolfgang Denk,

On 5 January 2012 17:02, Wolfgang Denk w...@denx.de wrote:
 Dear Chander Kashyap,

 In message 
 canuqghhy8_6m1riva6rawry0pvrx5nnykxd_p+u340a0d4j...@mail.gmail.com you 
 wrote:

  No need to reuse the code, if SoCs are different.
  If need, please separate the functions.

 Yes, though SoC's are different, the functionality in clock.c is
 similar. The only difference is the clock name in the clock structure
 for Exynos4 and Exynos5 but the functionality is exactly same in
 clock.c. To accommodate this change in clock name #ifdef is used.

 If this is the only difference, then I suggest just to rename the
 field in thesta structure.  Although it makes sense to follow the names
 in the documentation, it is sometimes better tochose a more suitable
 name - a comment in the header file should be sufficient to explain
 the rename (and to provide an anchor in case something greps for the
 name as used in the docs).

 Maybe we can avoid both #ifdef's and code duplication this way?
Thanks for the suggestion.

 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH,     MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 What was sliced bread the greatest thing since?



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-06 Thread Chander Kashyap
Dear Minkyu Kang,

On 6 January 2012 07:10, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 5 January 2012 19:31, Chander Kashyap chander.kash...@linaro.org wrote:
 Hi Minkyu Kang,

 On 5 January 2012 12:13, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 27 December 2011 17:48, Chander Kashyap chander.kash...@linaro.org 
 wrote:
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific 
 function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
 Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
 reuse the code in clock.c.
 What is the technical hindrance of not using ifdefs?

 No need to reuse the code, if SoCs are different.
 If need, please separate the functions.

 Yes, though SoC's are different, the functionality in clock.c is
 similar. The only difference is the clock name in the clock structure
 for Exynos4 and Exynos5 but the functionality is exactly same in
 clock.c. To accommodate this change in clock name #ifdef is used.

 Following is the function in clock .c which uses #ifdef to accommodate
 the different clock name in SoC's.

 static unsigned long exynos_get_pwm_clk(void)
 {
        struct exynos_clock *clk =
                (struct exynos_clock *)samsung_get_base_clock();
        unsigned long pclk, sclk;
        unsigned int sel;
        unsigned int ratio;

        if (s5p_get_cpu_rev() == 0) {
                /*
                 * CLK_SRC_{PERIL0 | PERIC0}
                 * PWM_SEL [27:24]
                 */
 #ifdef CONFIG_EXYNOS5
                sel = readl(clk-src_peric0);
 #else
                sel = readl(clk-src_peril0);
 #endif
                sel = (sel  24)  0xf;

                if (sel == 0x6)
                        sclk = get_pll_clk(MPLL);
                else if (sel == 0x7)
                        sclk = get_pll_clk(EPLL);
                else if (sel == 0x8)
                        sclk = get_pll_clk(VPLL);
                else
                        return 0;

                /*
                 * CLK_DIV_{PERIL3 | PERIC3}
                 * PWM_RATIO [3:0]
                 */
 #ifdef CONFIG_EXYNOS5
                ratio = readl(clk-div_peric3);
 #else
                ratio = readl(clk-div_peril3);
 #endif
                ratio = ratio  0xf;
        } else if (s5p_get_cpu_rev() == 1) {
                sclk = get_pll_clk(MPLL);
                ratio = 8;
        } else
                return 0;

        pclk = sclk / (ratio + 1);

        return pclk;
 }

 As listed above, the exynos_get_pwm_clk(() function is fully reusable
 for both Exynos4 and Exynos5. The #ifdef was used to get around the
 different clock names of Exynos4 and Exynos5.

 Another option here could be, that the differing clock name
 (src_peril0 for Exynos4 and src_peric0 for Exynos5) is resolved by
 change the src_peric0 to src_peril0 for Exynos5, and clearly
 commenting the reason for the deviation from the user manual. Would
 this approach be acceptable ?


 Using same clock's name is acceptable.

 But exynos4 clock structure and exynos5 clock structure are different.
 I requested removing all ifdefs in your patch.
 So, I will not allow such cases.
In that case S5PC1XX approach is suitable.

 +#ifdef CONFIG_EXYNOS4
 +#includeasm/arch/clock_exynos4.h
 +#elif defined CONFIG_EXYNOS5
 +#includeasm/arch/clock_exynos5.h
  #endif

 Then, we should do like this,

         struct exynos4_clock *clk =
                 (struct exynos4_clock *)samsung_get_base_clock();

         struct exynos5_clock *clk =
                 (struct exynos5_clock *)samsung_get_base_clock();

 how solve it?

 And you should consider variation by cpu revision.
 If Exynos5 revision1 is different from Exynos4 revision1, then?

I will resend patche based on s5pc1xx approch.
 Thanks.
 Minkyu Kang.
 --
 from. prom.
 www.promsoft.net



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de

[U-Boot] [PATCH V2] ARMV7: Add support for TRATS board

2012-01-06 Thread HeungJun, Kim
This patch adds support for Samsung TRATS board

Signed-off-by: HeungJun, Kim riverful@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 MAINTAINERS |4 +
 board/samsung/trats/Makefile|   45 ++
 board/samsung/trats/lowlevel_init.S |   50 +++
 board/samsung/trats/lowlevel_util.c |  137 ++
 board/samsung/trats/trats.c |  250 +++
 board/samsung/trats/trats_setup.h   |  812 +++
 boards.cfg  |1 +
 include/configs/trats.h |  216 ++
 8 files changed, 1515 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/trats/Makefile
 create mode 100644 board/samsung/trats/lowlevel_init.S
 create mode 100644 board/samsung/trats/lowlevel_util.c
 create mode 100644 board/samsung/trats/trats.c
 create mode 100644 board/samsung/trats/trats_setup.h
 create mode 100644 include/configs/trats.h

diff --git a/MAINTAINERS b/MAINTAINERS
index a56ca10..b760e7f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -705,6 +705,10 @@ Chander Kashyap k.chan...@samsung.com
origen  ARM ARMV7 (EXYNOS4210 SoC)
SMDKV310ARM ARMV7 (EXYNOS4210 SoC)
 
+Heungjun Kim riverful@samsung.com
+
+   trats   ARM ARMV7 (EXYNOS4210 SoC)
+
 Torsten Koschorrek koschor...@synertronixx.de
scb9328 ARM920T (i.MXL)
 
diff --git a/board/samsung/trats/Makefile b/board/samsung/trats/Makefile
new file mode 100644
index 000..77bd4a8
--- /dev/null
+++ b/board/samsung/trats/Makefile
@@ -0,0 +1,45 @@
+#
+# Copyright (C) 2011 Samsung Electronics
+# Heungjun Kim riverful@samsung.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 $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y:= trats.o lowlevel_util.o
+SOBJS  := lowlevel_init.o
+
+SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(SOBJS) $(OBJS)
+   $(call cmd_link_o_target, $(SOBJS) $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/samsung/trats/lowlevel_init.S 
b/board/samsung/trats/lowlevel_init.S
new file mode 100644
index 000..9159063
--- /dev/null
+++ b/board/samsung/trats/lowlevel_init.S
@@ -0,0 +1,50 @@
+/*
+ * Lowlevel setup for TRATS board based on EXYNOS4210
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ * Heungjun Kim riverful@samsung.com
+ * Kyungmin Park kyungmin.p...@samsung.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 config.h
+#include version.h
+#include asm/arch/cpu.h
+#include asm/arch/clock.h
+#include trats_setup.h
+
+   .globl pmu_init
+   .globl uart_init
+   .globl watchdog_disable
+   .globl clock_init
+   .globl pmic_reset
+
+   .globl lowlevel_init
+lowlevel_init:
+   push{lr}
+
+   bl  pmic_reset  @ PMIC reset
+   bl  clock_init  @ Init Clock
+   bl  watchdog_disable@ Disable Watchdog
+   bl  uart_init   @ Init UART
+   bl  pmu_init@ Init PMU
+
+   pop {pc}
+   nop
diff --git a/board/samsung/trats/lowlevel_util.c 

Re: [U-Boot] [PATCH V2] ARMV7: Add support for TRATS board

2012-01-06 Thread HeungJun, Kim
Hi Wolfgang Denk,

This is related with this:
http://lists.denx.de/pipermail/u-boot/2012-January/114710.html

And, I prepared version 2 patch modified with:
 1) sorting the list of the name in MAINTAINERS
 2) modifying to GPLv2+
 3) change assem code in lowlevel_init.S to C code in lowlevel_util.c
 4) do not defile values for variables if the variable is feature
 5) Remove miscellaneouses.

Thanks and Regards,
Heungjun Kim

 -Original Message-
 From: HeungJun, Kim [mailto:riverful@samsung.com]
 Sent: Friday, January 06, 2012 9:55 PM
 To: u-boot@lists.denx.de
 Cc: w...@denx.de; kyungmin.p...@samsung.com; mk7.k...@samsung.com; HeungJun, 
 Kim
 Subject: [PATCH V2] ARMV7: Add support for TRATS board
 
 This patch adds support for Samsung TRATS board
 
 Signed-off-by: HeungJun, Kim riverful@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  MAINTAINERS |4 +
  board/samsung/trats/Makefile|   45 ++
  board/samsung/trats/lowlevel_init.S |   50 +++
  board/samsung/trats/lowlevel_util.c |  137 ++
  board/samsung/trats/trats.c |  250 +++
  board/samsung/trats/trats_setup.h   |  812
+++
  boards.cfg  |1 +
  include/configs/trats.h |  216 ++
  8 files changed, 1515 insertions(+), 0 deletions(-)
  create mode 100644 board/samsung/trats/Makefile
  create mode 100644 board/samsung/trats/lowlevel_init.S
  create mode 100644 board/samsung/trats/lowlevel_util.c
  create mode 100644 board/samsung/trats/trats.c
  create mode 100644 board/samsung/trats/trats_setup.h
  create mode 100644 include/configs/trats.h
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index a56ca10..b760e7f 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -705,6 +705,10 @@ Chander Kashyap k.chan...@samsung.com
   origen  ARM ARMV7 (EXYNOS4210 SoC)
   SMDKV310ARM ARMV7 (EXYNOS4210 SoC)
 
 +Heungjun Kim riverful@samsung.com
 +
 + trats   ARM ARMV7 (EXYNOS4210 SoC)
 +
  Torsten Koschorrek koschor...@synertronixx.de
   scb9328 ARM920T (i.MXL)
 
 diff --git a/board/samsung/trats/Makefile b/board/samsung/trats/Makefile
 new file mode 100644
 index 000..77bd4a8
 --- /dev/null
 +++ b/board/samsung/trats/Makefile
 @@ -0,0 +1,45 @@
 +#
 +# Copyright (C) 2011 Samsung Electronics
 +# Heungjun Kim riverful@samsung.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 $(TOPDIR)/config.mk
 +
 +LIB  = $(obj)lib$(BOARD).o
 +
 +COBJS-y  := trats.o lowlevel_util.o
 +SOBJS:= lowlevel_init.o
 +
 +SRCS:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 +OBJS := $(addprefix $(obj),$(COBJS-y))
 +SOBJS:= $(addprefix $(obj),$(SOBJS))
 +
 +$(LIB):  $(obj).depend $(SOBJS) $(OBJS)
 + $(call cmd_link_o_target, $(SOBJS) $(OBJS))
 +
 +#
 +
 +# defines $(obj).depend target
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 diff --git a/board/samsung/trats/lowlevel_init.S
 b/board/samsung/trats/lowlevel_init.S
 new file mode 100644
 index 000..9159063
 --- /dev/null
 +++ b/board/samsung/trats/lowlevel_init.S
 @@ -0,0 +1,50 @@
 +/*
 + * Lowlevel setup for TRATS board based on EXYNOS4210
 + *
 + * Copyright (C) 2011 Samsung Electronics
 + * Heungjun Kim riverful@samsung.com
 + * Kyungmin Park kyungmin.p...@samsung.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
 + * 

Re: [U-Boot] [PATCH v2 3/9] openrisc: Add cpu files

2012-01-06 Thread Stefan Kristiansson
On Thu, Jan 05, 2012 at 06:15:48PM -0500, Mike Frysinger wrote:
 On Thursday 22 December 2011 06:39:32 Stefan Kristiansson wrote:
  On Thu, Dec 22, 2011 at 10:09:30AM +0100, Michal Simek wrote:
   Stefan Kristiansson wrote:
   +
   +void dcache_enable(void)
   +{
   +mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_DCE);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   +asm volatile(l.nop);
   
   This is interesting. Are there 8 nops?
   Is there any reason for that? Is it just any waiting?
   If yes, maybe it will be worth to add any comment.
  
  Yes, the number of nops are kind of arbitrary,
  they are there to add some headroom for the cache
  to startup without any load/stores in flight.
  
  But you are right, a comment about this might be in place.
 
 this is usually why the ISA provides some sort of sync or latch mechanism.  
 that way code is deterministic instead of being unsettling arbitrary (like it 
 is here).

The OpenRISC ISA does provide synch mechanisms, but they are unfortunately
optional and not supported by the (currently) only open implementation (or1200).

Stefan
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Parameter restriction in mxsboot tool

2012-01-06 Thread Robert Deliën
Hi,

Currently, the mxsboot tool checks all parsed options for being an even number, 
including
the partition sector for SD/MMC devices. I don't believe such a restriction 
exists; I've been
(unintentionally) using an odd sectored part ion for some time now.

Shall I change it? If yes; any objections against using 'getopt' to figure out 
the parsed options?

Cheers,

 Robert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Multi-os on OMAP4430 mp

2012-01-06 Thread Clemens Fischer
Hi,
I am currently examining the posibility of multiple operating systems on
embedded devices.
After some research I found out that amp is possible on a freescale
p2020 using u-boot.
There is a simple description in README.p2020rdb which includes the
u-boot commands fdt and cpu. I know that fdt is used to manipulate
device trees and cpu is used for cpu activate, deactivate and release of
the power mpc85xx and mpc86xx cpus. I had a look at
arch/powerpc/cpu/mpc85xx/mp.c and arch/powerpc/cpu/mpc85xx/fdt.c.

My question is:
Is there a similar implementation for the OMAP4430 mp cpus?

Is it generally possible to boot two independent operating systems on an
OMAP4430 platform using u-boot?

Thanks
Clemens

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] A Problem of u-boot on TI PandaBoard porting

2012-01-06 Thread Ira W. Snyder
On Fri, Jan 06, 2012 at 12:35:28AM -0500, Peter Barada wrote:
 On 01/06/2012 12:21 AM, qiao.hellowo...@gmail.com wrote:
  2012/1/6 John Rigbyjohn.ri...@linaro.org
 
  *u-boot/spl/u-boot-spl.lds:1: syntax error
  make[1]: *** [/home/qian/Desktop/u-boot/spl/u-boot-spl] Error 1
  make[1]: Leaving directory `/home/qian/Desktop/u-boot/spl'
  make: *** [spl/u-boot-spl.bin] Error 2*
 
  I’ve check the file ‘spl/u-boot-spl.lds’, the first line is a comment as
  below:
  *// add PandaTest Configuration*
 
  Change that comment to a C style one like /* . */ and I think the
  problem will go away.
 
  But it doesn't work...because the 'spl/u-boot-spl.lds' is automatically
  generated while building. Even if I modify this file, it will be replaced
  again when I rebuild.
 
  However, thanks for your reply.
 Then dig through the build log to find where the file is generated from 
 and modify that file...
 

I've run into a problem similar to this before. You probably have a C++
style comment inside your board configuration file. Change it to a C
style comment instead, and the problem goes away.

Ira
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Possible Denx m28evk ethernet problem + solution

2012-01-06 Thread Robert Deliën
Hi Marek,

I'm currently working on U-Boot support for the Freescale i.mx28evk board. It 
started out as
an update of the old Freescale supplied U-Boot 2009.08, but it ended up in 
reconfiguring
your work on the Denx m28evk module. Today I stumbled upon a problem with 
Ethernet.

It turned out that communication with the PHYs didn't work, because the SoC 
isn't supplying
ENET_CLK. The Ethernet clock is configured properly by cpu_eth_init in
./arch/arm/cpu/arm926ejs/mx28/mx28.c. But later in the boot process, 
board_eth_init in
board/denx/m28evk/m28evk.c tries to configure the Ethernet clock again. 
Unfortunately that
second configuration is just disabling the clock:
clrsetbits_le32(clkctrl_regs-hw_clkctrl_enet,
CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,
CLKCTRL_ENET_TIME_SEL_RMII_CLK);
After removing this line, I measured a 25MHz clock, communication with the PHYs 
worked
and I successfully tftp'ed a kernel from my server.

Does Ethernet on your board work? Does you board have an external clock 
oscillator for
the PHYs? If not, do you agree with removing this line?

Cheers,

Robert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Parameter restriction in mxsboot tool

2012-01-06 Thread Marek Vasut
 Hi,
 
 Currently, the mxsboot tool checks all parsed options for being an even
 number, including the partition sector for SD/MMC devices. I don't believe
 such a restriction exists; I've been (unintentionally) using an odd
 sectored part ion for some time now.
 
 Shall I change it? If yes; any objections against using 'getopt' to figure
 out the parsed options?
 
 Cheers,
 
  Robert.

Patch is always welcome.
M
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-06 Thread Scott Wood
On 01/05/2012 06:41 PM, Tom Rini wrote:
 On Thu, Jan 5, 2012 at 4:04 PM, Scott Wood scottw...@freescale.com wrote:
 Whatever the set of things is that you want to pull in for these SPLs,
 it needs to be a separate config option from the one that enables
 libnand.o to be included, so that other SPLs can pull in smaller NAND
 implementations.

 Is there any reason to keep defines like CONFIG_SPL_NAND_SUPPORT (versus
 LIBS-y += drivers/mtd/nand/libnand.o), if everything within that
 directory needs a separate config symbol to enable it inside an SPL
 (just like a normal build)?
 
 I think you've got it backwards.  What CONFIG_SPL_NAND_SUPPORT enables
 today is more bloated than required as our 'magic' isn't working.

I realize this isn't the case today -- but it's where we need to go,
since gc-sections doesn't do the job.  I was saying that I think we can
get rid of CONFIG_SPL_NAND_SUPPORT once we change to a model where every
bit of code within the directory needs some other config symbol to pull
it in.

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Possible Denx m28evk ethernet problem + solution

2012-01-06 Thread Marek Vasut
 Hi Marek,
 
 I'm currently working on U-Boot support for the Freescale i.mx28evk board.

This is already supported mainline.

 It started out as an update of the old Freescale supplied U-Boot 2009.08,
 but it ended up in reconfiguring your work on the Denx m28evk module.
 Today I stumbled upon a problem with Ethernet.
 
 It turned out that communication with the PHYs didn't work, because the SoC
 isn't supplying ENET_CLK.

The DENX board is actually ok, working properly, you don't understand what's 
going on in there. The RMII mode of PHY supplies clock to CPU. Read the manual 
before you start doing some wild acusations please :-)

 The Ethernet clock is configured properly by
 cpu_eth_init in ./arch/arm/cpu/arm926ejs/mx28/mx28.c. But later in the
 boot process, board_eth_init in board/denx/m28evk/m28evk.c tries to
 configure the Ethernet clock again. Unfortunately that second
 configuration is just disabling the clock:
   clrsetbits_le32(clkctrl_regs-hw_clkctrl_enet,
   CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,
   CLKCTRL_ENET_TIME_SEL_RMII_CLK);
 After removing this line, I measured a 25MHz clock, communication with the
 PHYs worked and I successfully tftp'ed a kernel from my server.

It's different -- M28EVK and MX28EVK are.
 
 Does Ethernet on your board work?

Yes.

 Does you board have an external clock
 oscillator for the PHYs?

Yes.

 If not, do you agree with removing this line?

No.

 
 Cheers,
 
 Robert.

M
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] add nand spl boot for qi_lb60 board

2012-01-06 Thread Scott Wood
On 01/06/2012 04:18 AM, Xiangfu Liu wrote:
 On 01/06/2012 02:44 AM, Scott Wood wrote:
 Use mips-whatever-objdump -dlrsh on the good and bad u-boot binaries
 (or on any .o files you suspect may be relevant), to see more
 specifically what's different.

 You may also want to try compiling suspect files to assembly and
 comparing the differences there.

 -Scott
 
 thanks Scott. a working patch is coming soon.
 
 forget add CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST to board configure head
 file.

That still doesn't explain how a few duplicate externs changed the
resulting binary...

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-06 Thread Tom Rini
On Fri, Jan 6, 2012 at 12:03 PM, Scott Wood scottw...@freescale.com wrote:
 On 01/05/2012 06:41 PM, Tom Rini wrote:
 On Thu, Jan 5, 2012 at 4:04 PM, Scott Wood scottw...@freescale.com wrote:
 Whatever the set of things is that you want to pull in for these SPLs,
 it needs to be a separate config option from the one that enables
 libnand.o to be included, so that other SPLs can pull in smaller NAND
 implementations.

 Is there any reason to keep defines like CONFIG_SPL_NAND_SUPPORT (versus
 LIBS-y += drivers/mtd/nand/libnand.o), if everything within that
 directory needs a separate config symbol to enable it inside an SPL
 (just like a normal build)?

 I think you've got it backwards.  What CONFIG_SPL_NAND_SUPPORT enables
 today is more bloated than required as our 'magic' isn't working.

 I realize this isn't the case today -- but it's where we need to go,
 since gc-sections doesn't do the job.  I was saying that I think we can
 get rid of CONFIG_SPL_NAND_SUPPORT once we change to a model where every
 bit of code within the directory needs some other config symbol to pull
 it in.

Ah, OK.  But maybe this also means we need to rethink other parts of
SPL too?  I'd imagine this isn't a NAND subsystem specific issue we're
running into.

-- 
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] NAND: Allow nand_ids and nand_bbt to be compiled in SPL

2012-01-06 Thread Scott Wood
On 01/06/2012 01:14 PM, Tom Rini wrote:
 On Fri, Jan 6, 2012 at 12:03 PM, Scott Wood scottw...@freescale.com wrote:
 On 01/05/2012 06:41 PM, Tom Rini wrote:
 On Thu, Jan 5, 2012 at 4:04 PM, Scott Wood scottw...@freescale.com wrote:
 Whatever the set of things is that you want to pull in for these SPLs,
 it needs to be a separate config option from the one that enables
 libnand.o to be included, so that other SPLs can pull in smaller NAND
 implementations.

 Is there any reason to keep defines like CONFIG_SPL_NAND_SUPPORT (versus
 LIBS-y += drivers/mtd/nand/libnand.o), if everything within that
 directory needs a separate config symbol to enable it inside an SPL
 (just like a normal build)?

 I think you've got it backwards.  What CONFIG_SPL_NAND_SUPPORT enables
 today is more bloated than required as our 'magic' isn't working.

 I realize this isn't the case today -- but it's where we need to go,
 since gc-sections doesn't do the job.  I was saying that I think we can
 get rid of CONFIG_SPL_NAND_SUPPORT once we change to a model where every
 bit of code within the directory needs some other config symbol to pull
 it in.
 
 Ah, OK.  But maybe this also means we need to rethink other parts of
 SPL too?  I'd imagine this isn't a NAND subsystem specific issue we're
 running into.

Right, the toplevel config symbol on a directory only makes sense if
there's code that will be wanted by all SPLs using that directory -- and
given the nature of SPL, that's probably not going to be the case very
often.

-Scott

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Secure update of uboot devices?

2012-01-06 Thread Mike Frysinger
On Friday 06 January 2012 06:24:50 Andreas Bäck wrote:
 Actually there seams to exsist some very old patches for this
 http://lists.denx.de/pipermail/u-boot/2006-September/016960.html
 
 Here a paper quite exact what I am after:
 http://elinux.org/images/2/28/Trusted_Boot_Loader.pdf
 
 Is there any toughts on integating this in trunk or should I try to merge
 this patch with the git trunk of my own?

i think you need to outline exactly what it is you're trying to do.  secure 
update and secure boot is way too vague.  for starters, you need to outline 
the vectors you're trying to protect against.  the arm trustzone whitepaper is 
a pretty good example of things:
http://infocenter.arm.com/help/topic/com.arm.doc.prd29-genc-009492c/PRD29-
GENC-009492C_trustzone_security_whitepaper.pdf

there are many hardware solutions out there for verifying the integrity of u-
boot itself before executing it, but they tend to be SoC/arch specific.  the 
trusted boot paper you referred to for example really only makes sense on x86 
based platforms.

the patch you referred to however is for verifying the integrity of the kernel 
image that u-boot boots.  it doesn't help with u-boot itself.
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/9] openrisc: Add cpu files

2012-01-06 Thread Mike Frysinger
On Friday 06 January 2012 08:22:54 Stefan Kristiansson wrote:
 On Thu, Jan 05, 2012 at 06:15:48PM -0500, Mike Frysinger wrote:
  On Thursday 22 December 2011 06:39:32 Stefan Kristiansson wrote:
   On Thu, Dec 22, 2011 at 10:09:30AM +0100, Michal Simek wrote:
Stefan Kristiansson wrote:
+
+void dcache_enable(void)
+{
+  mtspr(SPR_SR, mfspr(SPR_SR) | SPR_SR_DCE);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);
+  asm volatile(l.nop);

This is interesting. Are there 8 nops?
Is there any reason for that? Is it just any waiting?
If yes, maybe it will be worth to add any comment.
   
   Yes, the number of nops are kind of arbitrary,
   they are there to add some headroom for the cache
   to startup without any load/stores in flight.
   
   But you are right, a comment about this might be in place.
  
  this is usually why the ISA provides some sort of sync or latch
  mechanism. that way code is deterministic instead of being unsettling
  arbitrary (like it is here).
 
 The OpenRISC ISA does provide synch mechanisms, but they are unfortunately
 optional and not supported by the (currently) only open implementation
 (or1200).

sounds like a CONFIG knob for people :).  i imagine the # of nop's require 
depends heavily on how the core is laid out in hardware, the speed, etc...
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Possible Denx m28evk ethernet problem + solution

2012-01-06 Thread Robert Deliën
 I'm currently working on U-Boot support for the Freescale i.mx28evk board.
 
 This is already supported mainline.

Hm; my workspace is quite up-to-date, but I didn't find it. What configuration
should I use for the Freescale i.mx28evk board? m28evk_config boots the
board, but not much more. The difference between the Freescale i.mx28evk
board and the Denx m28evk modules are too big (eg. ssp2 for mmc1, etc.)

 The DENX board is actually ok, working properly,

I don't doubt the working of the Denx module; I'm sure it works fine, but I 
don't
have one laying around, so I cannot check. However, the configuration for the
Denx m28evk module doesn't work very well on the Freescale i.mx28evk board.

 you don't understand what's 
 going on in there.

No need to be harsh; I don't have a diagram of the Denx board, so I don't
know what clock configuration was chosen for it's design.

 The RMII mode of PHY supplies clock to CPU. Read the manual 
 before you start doing some wild acusations please :-)

On my board, there wasn't any clock signal between the SoC and the PHYs,
regardless of who's supposed to source it. I can lift R171 and check who's
supplying it after my modification, but I'm pretty sure it's the SoC. This 
situation
works, but may still be wrong; No argument there. But this is the same
situation as the old Freescale supplied u-boot 2009.08 does it.

I don't see how the LAN8720 PHY can supply a clock to the SoC. XTAL1 is
an output only and XTAL2 is only intended to drive a chrystal, and not
connected anyway. Are we talking about the same board?

 The Ethernet clock is configured properly by
 cpu_eth_init in ./arch/arm/cpu/arm926ejs/mx28/mx28.c. But later in the
 boot process, board_eth_init in board/denx/m28evk/m28evk.c tries to
 configure the Ethernet clock again. Unfortunately that second
 configuration is just disabling the clock:
  clrsetbits_le32(clkctrl_regs-hw_clkctrl_enet,
  CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,
  CLKCTRL_ENET_TIME_SEL_RMII_CLK);
 After removing this line, I measured a 25MHz clock, communication with the
 PHYs worked and I successfully tftp'ed a kernel from my server.
 
 It's different -- M28EVK and MX28EVK are.

Yes, I know. I'm working with the MX28EVK, not the M28EVK.

 Does you board have an external clock
 oscillator for the PHYs?
 
 Yes.

Aha, so we are talking about different boards.

 If not, do you agree with removing this line?
 
 No.

I'm sorry; I asked the wrong question. What I should have asked was: Do you 
agree
with not copying this line to the MX28EVK configuration?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 05/15] common/main.c: Fix function readline

2012-01-06 Thread Mike Frysinger
On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
  * Ignore ANSI escape codes for moving cursor, which are generated by
 keyboard

this probably should be behind an appropriate CONFIG knob.  i don't think this 
is relevant to serial users (which are the majority of boards).
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/9] Fix strict-aliasing warning in dlmalloc

2012-01-06 Thread Simon Glass
Hi Wolfgang,

On Thu, Jan 5, 2012 at 10:48 PM, Wolfgang Denk w...@denx.de wrote:
 Dear Simon Glass,

 In message 1325822097-15227-3-git-send-email-...@chromium.org you wrote:
 This fixes the following warnings in dlmalloc seen with my gcc 4.6.

 Which exact version is this?

 dlmalloc.c: In function 'malloc_bin_reloc':
 dlmalloc.c:1493: warning: dereferencing pointer 'p' does break 
 strict-aliasing rules
 dlmalloc.c:1493: warning: dereferencing pointer 'p' does break 
 strict-aliasing rules
 dlmalloc.c:1490: note: initialized from here
 dlmalloc.c:1493: note: initialized from here

 Can you please tell me at least one board configuration that throws
 this error (preferrably ppc, arm or mips) ?

I can't see one with those architectures. It does happen for others though:

$ (for b in $(cd ~/cosarm/buildall/logs.master.9a42098  grep -l 1493
*ERR |sed 's/.ERR//'); do grep $b boards.cfg; done ) |awk '{print $2,
$1}'
avr32 atngw100
avr32 atstk1002
avr32 atstk1003
avr32 atstk1004
avr32 atstk1006
mips dbau1000
mips dbau1100
mips dbau1500
mips dbau1550
mips dbau1550_el
avr32 favr-32-ezkit
avr32 grasshopper
mips gth2
avr32 hammerhead
mips incaip
mips incaip_100MHz
mips incaip_133MHz
mips incaip_150MHz
m68k M54451EVB
m68k M54451EVB_stmicro
m68k M54451EVB_stmicro
m68k M54455EVB_a66
m68k M54455EVB
m68k M54455EVB_a66
m68k M54455EVB_i66
m68k M54455EVB_intel
m68k M54455EVB_stm33
m68k M54455EVB_i66
m68k M54455EVB_intel
m68k M54455EVB_stm33
m68k M5475AFE
m68k M5475BFE
m68k M5475CFE
m68k M5475DFE
m68k M5475EFE
m68k M5475FFE
m68k M5475GFE
m68k M5485AFE
m68k M5485BFE
m68k M5485CFE
m68k M5485DFE
m68k M5485EFE
m68k M5485FFE
m68k M5485GFE
m68k M5485HFE
avr32 mimc200
mips qemu_mips
mips vct_platinumavc
mips vct_platinumavc_onenand
mips vct_platinumavc_onenand_small
mips vct_platinumavc_small
mips vct_platinumavc_onenand
mips vct_platinumavc_onenand_small
mips vct_platinumavc_onenand_small
mips vct_platinumavc_small
mips vct_platinum
mips vct_platinumavc
mips vct_platinumavc_onenand
mips vct_platinumavc_onenand_small
mips vct_platinumavc_small
mips vct_platinum_onenand
mips vct_platinum_onenand_small
mips vct_platinum_small
mips vct_platinum_onenand
mips vct_platinum_onenand_small
mips vct_platinum_onenand_small
mips vct_platinum_small
mips vct_premium
mips vct_premium_onenand
mips vct_premium_onenand_small
mips vct_premium_small
mips vct_premium_onenand
mips vct_premium_onenand_small
mips vct_premium_onenand_small
mips vct_premium_small

Using built-in specs.
Target: mips-linux
Configured with: /home/tony/buildall/src/gcc/configure
--target=mips-linux --enable-targets=all
--prefix=/opt/cross/gcc-4.4.4-nolibc/mips-linux/ --enable-languages=c
--with-newlib --without-headers --enable-sjlj-exceptions
--with-system-libunwind --disable-nls --disable-threads
--disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --enable-checking=release
--with-mpfr=/home/tony/buildall/src/sys
--with-gmp=/home/tony/buildall/src/sys
Thread model: single
gcc version 4.4.4 (GCC)

Using built-in specs.
Target: m68k-linux
Configured with: /home/tony/buildall/src/gcc/configure
--target=m68k-linux --enable-targets=all
--prefix=/opt/cross/gcc-4.4.4-nolibc/m68k-linux/ --enable-languages=c
--with-newlib --without-headers --enable-sjlj-exceptions
--with-system-libunwind --disable-nls --disable-threads
--disable-shared --disable-libmudflap --disable-libssp
--disable-libgomp --disable-decimal-float --enable-checking=release
--with-mpfr=/home/tony/buildall/src/sys
--with-gmp=/home/tony/buildall/src/sys
Thread model: single
gcc version 4.4.4 (GCC)

Using built-in specs.
Target: powerpc-linux
Configured with: /home/tony/buildall/src/gcc/configure
--target=powerpc-linux --enable-targets=all
--prefix=/opt/cross/gcc-4.4.4-nolibc/powerpc-linux/
--enable-languages=c --with-newlib --without-headers
--enable-sjlj-exceptions --with-system-libunwind --disable-nls
--disable-threads --disable-shared --disable-libmudflap
--disable-libssp --disable-libgomp --disable-decimal-float
--enable-checking=release --with-mpfr=/home/tony/buildall/src/sys
--with-gmp=/home/tony/buildall/src/sys
Thread model: single
gcc version 4.4.4 (GCC)

From here:

http://dev.gentoo.org/~vapier/u-boot/


 Also, at least one for the mpc5xxx: Fix strict-aliasing warnings in
 usb_ohci.c and ppc4xx: Fix strict-aliasing warnings in usb_ohci.c
 patches?

powerpc BC3450
powerpc cm5200
powerpc EVAL5200
powerpc galaxy5200
powerpc galaxy5200_LOWBOOT
powerpc galaxy5200_LOWBOOT
powerpc inka4x0
powerpc mcc200_COM12
powerpc mcc200_COM12_highboot
powerpc mcc200_COM12_highboot_SDRAM
powerpc mcc200_COM12_SDRAM
powerpc mcc200_COM12_highboot
powerpc mcc200_COM12_highboot_SDRAM
powerpc mcc200_COM12_highboot_SDRAM
powerpc mcc200_COM12_SDRAM
powerpc mcc200
powerpc mcc200_COM12
powerpc mcc200_COM12_highboot
powerpc mcc200_COM12_highboot_SDRAM
powerpc mcc200_COM12_SDRAM
powerpc mcc200_highboot
powerpc mcc200_highboot_SDRAM
powerpc mcc200_SDRAM
powerpc prs200
powerpc prs200_DDR
powerpc 

Re: [U-Boot] Possible Denx m28evk ethernet problem + solution

2012-01-06 Thread Marek Vasut
  I'm currently working on U-Boot support for the Freescale i.mx28evk
  board.
  
  This is already supported mainline.
 
 Hm; my workspace is quite up-to-date, but I didn't find it. What
 configuration should I use for the Freescale i.mx28evk board?
 m28evk_config boots the board, but not much more. The difference between
 the Freescale i.mx28evk board and the Denx m28evk modules are too big (eg.
 ssp2 for mmc1, etc.)

make mx28evk_config? board/freescale/mx28evk
 
  The DENX board is actually ok, working properly,
 
 I don't doubt the working of the Denx module; I'm sure it works fine, but I
 don't have one laying around, so I cannot check.

I did check, don't worry.

 However, the
 configuration for the Denx m28evk module doesn't work very well on the
 Freescale i.mx28evk board.

That's to be expected!
 
  you don't understand what's
  going on in there.
 
 No need to be harsh; I don't have a diagram of the Denx board, so I don't
 know what clock configuration was chosen for it's design.

Sorry, it wasn't meant to be too direct.
 
  The RMII mode of PHY supplies clock to CPU. Read the manual
  before you start doing some wild acusations please :-)
 
 On my board, there wasn't any clock signal between the SoC and the PHYs,
 regardless of who's supposed to source it. I can lift R171 and check who's
 supplying it after my modification, but I'm pretty sure it's the SoC. This
 situation works, but may still be wrong; No argument there. But this is
 the same situation as the old Freescale supplied u-boot 2009.08 does it.

Yes, it can go both ways.
 
 I don't see how the LAN8720 PHY can supply a clock to the SoC. XTAL1 is
 an output only and XTAL2 is only intended to drive a chrystal, and not
 connected anyway. Are we talking about the same board?

The PHY doesn't supply clock on mx28evk, CPU does.
 
  The Ethernet clock is configured properly by
  cpu_eth_init in ./arch/arm/cpu/arm926ejs/mx28/mx28.c. But later in the
  boot process, board_eth_init in board/denx/m28evk/m28evk.c tries to
  configure the Ethernet clock again. Unfortunately that second
  
  configuration is just disabling the clock:
 clrsetbits_le32(clkctrl_regs-hw_clkctrl_enet,
 
 CLKCTRL_ENET_TIME_SEL_MASK | CLKCTRL_ENET_CLK_OUT_EN,
 CLKCTRL_ENET_TIME_SEL_RMII_CLK);
  
  After removing this line, I measured a 25MHz clock, communication with
  the PHYs worked and I successfully tftp'ed a kernel from my server.
  
  It's different -- M28EVK and MX28EVK are.
 
 Yes, I know. I'm working with the MX28EVK, not the M28EVK.
 
  Does you board have an external clock
  oscillator for the PHYs?
  
  Yes.
 
 Aha, so we are talking about different boards.
 
  If not, do you agree with removing this line?
  
  No.
 
 I'm sorry; I asked the wrong question. What I should have asked was: Do you
 agree with not copying this line to the MX28EVK configuration?

Yea ...

M28EVK: PHY supplies clock to CPU
MX28EVK: CPU supplies clock to PHY

Still, the support is already there.

M
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Possible Denx m28evk ethernet problem + solution

2012-01-06 Thread Robert Deliën
 make mx28evk_config? board/freescale/mx28evk

Are you sure you checked it in? I checked, but I couldn't find it.
(http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=tree;f=include/configs;h=fe894c3b95e3d154264c2f8731b668c410131f01;hb=HEAD)

 Yes, it can go both ways.

For the SoC I understand. But he PHYs on the Freescale don't, as
far as I know.
Anyway, the Denx module probably uses more advanced PHYs.

 The PHY doesn't supply clock on mx28evk, CPU does.

I'm glad we agree here.

 Yea ...
 
 M28EVK: PHY supplies clock to CPU
 MX28EVK: CPU supplies clock to PHY

It's getting rather obvious, now you've given me a bit of insight in the
differences between both boards. Thanks.

 Still, the support is already there.

I figured that too; I expected you probably made that first before moving
on to the Denx module. But I couldn't find it.
At first I thought m28evk_config would support it (too). The similarity in
names suggests similarity in boards. But after patching too much code,
I figured to implement mx28evk_config and board/freescale/mx28evk
myself. What a waste of time At least it was a good exercise before
our product boards arrive next week.

I just pulled my git repository and Make can't find a rule to make
mx28evk_config, so it's really not there. Not even hidden in another
configuration.

Wasn't it removed, since the Freescale implementation in 2009.08
broke?

Robert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/3] tegra2: Fix default RAM size selection in odmdata

2012-01-06 Thread Stephen Warren
A value of 0 in the odmdata RAM size field means default, which is 512MB
not 1GB. Fix this. For reference, see:

http://nv-tegra.nvidia.com/gitweb/?p=linux-2.6.git;a=blob;\
f=arch/arm/mach-tegra/odm_kit/query/harmony/tegra_devkit_custopt.h;\
h=1ec7010911454f19a5018952fd245785a62c59ad;\
hb=0e52d7fe25b11a656c376a37890be219470661fb

v2: New patch

Signed-off-by: Stephen Warren swar...@nvidia.com
---
 arch/arm/cpu/armv7/tegra2/board.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/board.c 
b/arch/arm/cpu/armv7/tegra2/board.c
index ea06570..404d34c 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -58,9 +58,9 @@ unsigned int query_sdram_size(void)
case 1:
return 0x1000;  /* 256 MB */
case 2:
+   default:
return 0x2000;  /* 512 MB */
case 3:
-   default:
return 0x4000;  /* 1GB */
}
 }
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/3] tegra2: Fix conflicting pinmux for UARTA

2012-01-06 Thread Stephen Warren
Tegra appears to boot with function UARTA pre-selected on mux
group SDB. If two mux groups are both set to the same function,
it's unclear which group's pins drive the RX signals into the
HW module. For UARTA, SDB certainly overrides group IRTX in
practice. To solve this, configure some alternative function on
SDB to avoid the conflict. Also, tri-state the group to avoid
driving any signal onto it until we know what's connected.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
 arch/arm/cpu/armv7/tegra2/funcmux.c |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c 
b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 0878f51..140f8a7 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -37,6 +37,18 @@ int funcmux_select(enum periph_id id, int config)
pinmux_set_func(PINGRP_IRTX, PMUX_FUNC_UARTA);
pinmux_tristate_disable(PINGRP_IRRX);
pinmux_tristate_disable(PINGRP_IRTX);
+   /*
+* Tegra appears to boot with function UARTA pre-selected on
+* mux group SDB. If two mux groups are both set to the same
+* function, it's unclear which group's pins drive the RX
+* signals into the HW module. For UARTA, SDB certainly
+* overrides group IRTX in practice. To solve this, configure
+* some alternative function on SDB to avoid the conflict. Also,
+* tri-state the group to avoid driving any signal onto it until
+* we know what's connected.
+*/
+   pinmux_tristate_enable(PINGRP_SDB);
+   pinmux_set_func(PINGRP_SDB,  PMUX_FUNC_SDIO3);
break;
 
case PERIPH_ID_UART2:
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/3] tegra2: Add support for Compal Paz00 (Toshiba AC100)

2012-01-06 Thread Stephen Warren
The Toshiba AC100 (Compal code-name Paz00, aka Dynabook AZ) is a netbook
derived from the NVIDIA Tegra Harmony reference board. It ships with
Android, but is often repurposed to run Linux. This patch adds just enough
support to get a U-Boot serial console, and the ability access built-in
eMMC and the external SD slot.

v2:
* Rebased on latest HEAD, incorporated changes made to other board files.
* Moved board files from board/nvidia to board/compal.
* Switched to correct odmdata value. This required add the previous patch
  to fix U-Boot's interpretation of the odmdata RAM size field.
* Removed nvmem= from default Linux kernel command-line; no drivers use the
  reserved memory yet, so there's no point reserving it.

Signed-off-by: Stephen Warren swar...@nvidia.com
---
 MAINTAINERS |1 +
 board/compal/paz00/Makefile |   41 ++
 board/compal/paz00/paz00.c  |   81 +++
 boards.cfg  |1 +
 include/configs/paz00.h |   51 +++
 5 files changed, 175 insertions(+), 0 deletions(-)
 create mode 100644 board/compal/paz00/Makefile
 create mode 100644 board/compal/paz00/paz00.c
 create mode 100644 include/configs/paz00.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 4bf12b5..9c796e2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -891,6 +891,7 @@ Tom Warren twar...@nvidia.com
 Stephen Warren swar...@nvidia.com
 
ventana Tegra2 (ARM7  A9 Dual Core)
+   paz00   Tegra2 (ARM7  A9 Dual Core)
 
 Thomas Weber we...@corscience.de
 
diff --git a/board/compal/paz00/Makefile b/board/compal/paz00/Makefile
new file mode 100644
index 000..488e381
--- /dev/null
+++ b/board/compal/paz00/Makefile
@@ -0,0 +1,41 @@
+#
+# Copyright (c) 2010-2012, NVIDIA CORPORATION.  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 and conditions of the GNU General Public License,
+# version 2, as published by the Free Software Foundation.
+#
+# This program is distributed in the hope 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.
+#
+
+include $(TOPDIR)/config.mk
+
+ifneq ($(OBJTREE),$(SRCTREE))
+$(shell mkdir -p $(obj)../../nvidia/common)
+endif
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+COBJS  += ../../nvidia/common/board.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c
new file mode 100644
index 000..3b48917
--- /dev/null
+++ b/board/compal/paz00/paz00.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2010-2012, NVIDIA CORPORATION.  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 and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope 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.
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/arch/tegra2.h
+#include asm/arch/pinmux.h
+#include asm/arch/mmc.h
+#include asm/gpio.h
+#ifdef CONFIG_TEGRA2_MMC
+#include mmc.h
+#endif
+
+/*
+ * Routine: gpio_config_uart
+ * Description: Does nothing on Paz00 - no conflict w/SPI.
+ */
+void gpio_config_uart(void)
+{
+}
+
+#ifdef CONFIG_TEGRA2_MMC
+/*
+ * Routine: pin_mux_mmc
+ * Description: setup the pin muxes/tristate values for the SDMMC(s)
+ */
+static void pin_mux_mmc(void)
+{
+   /* SDMMC4: config 3, x8 on 2nd set of pins */
+   pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
+   pinmux_set_func(PINGRP_GMA, PMUX_FUNC_SDIO4);
+   pinmux_set_func(PINGRP_GME, PMUX_FUNC_SDIO4);
+
+   pinmux_tristate_disable(PINGRP_ATB);
+   pinmux_tristate_disable(PINGRP_GMA);
+   pinmux_tristate_disable(PINGRP_GME);
+
+   /* SDMMC1: SDIO1_CLK, SDIO1_CMD, SDIO1_DAT[3:0] */
+   pinmux_set_func(PINGRP_SDMMC1, PMUX_FUNC_SDIO1);
+
+   pinmux_tristate_disable(PINGRP_SDMMC1);
+
+   /* For power GPIO PV1 */
+   pinmux_tristate_disable(PINGRP_UAC);
+   /* For CD GPIO PI5 */
+   pinmux_tristate_disable(PINGRP_ATC);
+}
+
+/* this is a weak define that we are overriding */

Re: [U-Boot] [PATCH v2] add nand spl boot for qi_lb60 board

2012-01-06 Thread Scott Wood
On 01/06/2012 04:17 AM, Xiangfu Liu wrote:
 Signed-off-by: Xiangfu Liu xian...@openmobilefree.net
 ---
  arch/mips/cpu/xburst/cpu.c   |4 +
  arch/mips/cpu/xburst/start_spl.S |   65 
  drivers/mtd/nand/jz4740_nand.c   |   40 +++-
  include/configs/qi_lb60.h|3 +
  nand_spl/board/qi/qi_lb60/Makefile   |  112 
 ++
  nand_spl/board/qi/qi_lb60/nand_spl.c |   37 +++
  nand_spl/board/qi/qi_lb60/u-boot.lds |   63 +++
  7 files changed, 321 insertions(+), 3 deletions(-)
  create mode 100644 arch/mips/cpu/xburst/start_spl.S
  create mode 100644 nand_spl/board/qi/qi_lb60/Makefile
  create mode 100644 nand_spl/board/qi/qi_lb60/nand_spl.c
  create mode 100644 nand_spl/board/qi/qi_lb60/u-boot.lds

We are transitioning from nand_spl/ to spl/.  Please try to work within
the new infrastructure.  You may run into problems with size in spl/,
due to gc-sections not removing strings on components you don't need --
I plan to fix those issues (for NAND), hopefully this merge window, by
requiring all files to be explicitly asked for.  Feel free to fix them
first if you'd like. :-)

 diff --git a/arch/mips/cpu/xburst/cpu.c b/arch/mips/cpu/xburst/cpu.c
 index e976341..afd166c 100644
 --- a/arch/mips/cpu/xburst/cpu.c
 +++ b/arch/mips/cpu/xburst/cpu.c
 @@ -42,6 +42,8 @@
   :   \
   : i (op), R (*(unsigned char *)(addr)))
  
 +#ifndef CONFIG_NAND_SPL
 +
  void __attribute__((weak)) _machine_restart(void)
  {
   struct jz4740_wdt *wdt = (struct jz4740_wdt *)JZ4740_WDT_BASE;
 @@ -109,6 +111,8 @@ void invalidate_dcache_range(ulong start_addr, ulong stop)
   cache_op(Hit_Invalidate_D, addr);
  }
  
 +#endif
 +
  void flush_icache_all(void)
  {
   u32 addr, t = 0;
 diff --git a/arch/mips/cpu/xburst/start_spl.S 
 b/arch/mips/cpu/xburst/start_spl.S
 new file mode 100644
 index 000..f137ccd
 --- /dev/null
 +++ b/arch/mips/cpu/xburst/start_spl.S
 @@ -0,0 +1,65 @@
 +/*
 + *  Startup Code for MIPS32 XBURST CPU-core
 + *
 + *  Copyright (c) 2010 Xiangfu Liu xian...@sharism.cc
 + *
 + * 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 3 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#include config.h
 +#include version.h
 +#include asm/regdef.h
 +#include asm/mipsregs.h
 +#include asm/addrspace.h
 +#include asm/cacheops.h
 +
 +#include asm/jz4740.h
 +
 + .set noreorder
 +
 + .globl _start
 + .text
 +_start:
 + .word JZ4740_NANDBOOT_CFG /* fetched during NAND Boot */
 +reset:
 + /*
 +  * STATUS register
 +  * CU0=UM=EXL=IE=0, BEV=ERL=1, IP2~7=1
 +  */
 + li  t0, 0x0040FC04
 + mtc0t0, CP0_STATUS
 + /*
 +  * CAUSE register
 +  * IV=1, use the specical interrupt vector (0x200)
 +  */
 + li  t1, 0x0080
 + mtc0t1, CP0_CAUSE
 +
 + bal 1f
 +  nop
 + .word   _GLOBAL_OFFSET_TABLE_
 +1:
 + movegp, ra
 + lw  t1, 0(ra)
 + movegp, t1
 +
 + la  sp, 0x80004000
 + la  t9, nand_spl_boot
 + j   t9
 +  nop

Shinya, do the MIPS parts look OK?

 +include $(TOPDIR)/config.mk
 +
 +LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 +LDFLAGS  = -Bstatic -T $(LDSCRIPT) -Ttext $(CONFIG_NAND_SPL_TEXT_BASE)
 +AFLAGS   += -DCONFIG_NAND_SPL
 +CFLAGS   += -DCONFIG_NAND_SPL -O2

Why -O2 and not the -Os that you should already be inheriting from
config.mk?

 +# The JZ4740 CPU can load two areas of data from NAND flash to internal SRAM,
 +# one is the normal area up to 8KB starting from NAND flash address 0, the
 +# other is the backup area up to 8KB starting from NAND flash address 0x2000.
 +
 +# After reset, the boot program will first read the normal area data from 
 NAND
 +# flash using hardware Reed-Solomon ECC. If no ECC error is detected or ECC
 +# error is correctable, the boot program then branches to internal SRAM at 4
 +# bytes offset. ff it detects an uncorrectable ECC error, it will continue to
 +# read the backup area of data from NAND flash using hardware Reed-Solomon 
 ECC.

Why must the payload come at offset 256K, rather than 16K?

 +
 +# those 'dd' commands is for create such two 8KB for 

[U-Boot] [PATCH] ns16550: tegra: Specify debugging serial port at boot.

2012-01-06 Thread Stephen Warren
From: Doug Anderson diand...@chromium.org

This works together with a kernel change that looks at the scratchpad
register to determine which of the many UARTs it should use for early
printing:

http://www.spinics.net/lists/arm-kernel/msg154633.html

While it is unfortunate to need to pass this information in a second way
(it's already in the device tree), this does allow the very early boot
code (decompressing stub and early assembly code) to print to the right
port.

At the moment, I'm adding this to the UART init function. Alternatively,
we could add a more complex patch to key off of the 'console' setting.

Signed-off-by: Doug Anderson diand...@chromium.org
[swarren: Limited the change to Tegra platforms]
Signed-off-by: Stephen Warren swar...@nvidia.com
---
 drivers/serial/ns16550.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 0c23955..19a28cd 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -62,6 +62,13 @@ void NS16550_init(NS16550_t com_port, int baud_divisor)
serial_out(0, com_port-mdr1);
 #endif
 #endif /* CONFIG_OMAP */
+#if defined(CONFIG_TEGRA2)
+   /*
+* Put a 'D' in the scratchpad to let the kernel know which UART
+* for earlyprintk [D]ebugging.
+*/
+   serial_out('D', com_port-spr);
+#endif
 }
 
 #ifndef CONFIG_NS16550_MIN_FUNCTIONS
-- 
1.7.0.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Revert common.h: remove value from bool defines

2012-01-06 Thread Wolfgang Denk
Dear Wolfgang Denk,

In message 1325841606-24698-1-git-send-email...@denx.de you wrote:
 This reverts commit 914c9ee971924665c9d2927fe83d8d70060b1eb8
 which is causing tons of build warnings like
 start.S:39:0: warning: _LINUX_CONFIG_H redefined [enabled by
 default]
 /home/wd/git/u-boot/work/include/common.h:28:0: note: this is the
 location of the previous definition
 /work/wd/tmp-ppc/nand_spl/board/freescale/mpc8315erdb/start.S:39:0:
 warning: _LINUX_CONFIG_H redefined [enabled by default]
 /home/wd/git/u-boot/work/include/common.h:28:0: note: this is the
 location of the previous definition
 etc.
 
 Signed-off-by: Wolfgang Denk w...@denx.de
 ---
  include/common.h |   16 
  1 files changed, 8 insertions(+), 8 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The universe does not have laws - it has habits, and  habits  can  be
broken.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] stuck after redirecting stdout to nc

2012-01-06 Thread Wolfgang Denk
Dear Ran Shalit,

In message CAJ2oMh+D0MKGXYiAvjy-uGA3DCssJPCn=n0fm5vc7j4h34x...@mail.gmail.com 
you wrote:

 2. Otherwise, if the network interface ip is not the same as ncip, or cable
 is disconnected the u-boot does not start bootcmd, and I actually do not
 know where it stoped and why.
 
 Please tell me if you have any advice where to look, and what should be
 checked,

Attach a JTAG debugger and fire up GDB.

 Content-Type: text/html; charset=ISO-8859-1
 Content-Transfer-Encoding: quoted-printable

And please STOP posting HTML!!

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
God made machine language; all the rest is the work of man.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Regarding HUSH support in uboot

2012-01-06 Thread Wolfgang Denk
Dear amruth vamadev,

In message CAL5DGCQABjk_F8T2-3XLFJkmp8ZvPwH_RvAa2i_==js+8__...@mail.gmail.com 
you wrote:

 Thanks for response.If I want to store those strings into variable and
 may be compare it or parse it for information.For example echo a
 redirected to variable like assignment. My goal is to write simple
 diags to test pci or serial flash using commands in the shell using
 script. We can issue the commands and parse the response and print
 useful messages to users.

Such test code should most probably be integrated into the POST
framework.

 myvar = echo a
 if itest.s myvar == a
 then echo 'a
 else echo no a
 Any idea how we can achieve this.

Current hush implementation does not support backticks or $(cmd)
notation.  You will have to chose a differnt style.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Unibus timeout fatal trap program lost sorry  -  An  error  message
printed by DEC's RSTS operating system for the PDP-11
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Secure update of uboot devices?

2012-01-06 Thread Wolfgang Denk
Dear =?ISO-8859-1?Q?Andreas_B=E4ck?=,

In message cab+ekh5g3ybyslgytbkatefvg_wzesyc3k0smfog4436dr6...@mail.gmail.com 
you wrote:
 
 Actually there seams to exsist some very old patches for this
 http://lists.denx.de/pipermail/u-boot/2006-September/016960.html
 
 Here a paper quite exact what I am after:
 http://elinux.org/images/2/28/Trusted_Boot_Loader.pdf
 
 Is there any toughts on integating this in trunk or should I try to merge
 this patch with the git trunk of my own?

If you read the comments to the old patches you know why that code did
not go into mainline then.  It would not go into mainline for the same
reasons today.  This needs a major rework.

The feature itself is certainly interesting, and (cleaned up) patcehs
are welcome.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I've seen it. It's rubbish.  - Marvin the Paranoid Android
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Possible Denx m28evk ethernet problem + solution

2012-01-06 Thread Marek Vasut
  make mx28evk_config? board/freescale/mx28evk
 
 Are you sure you checked it in? I checked, but I couldn't find it.
 (http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=tree;f=include/config
 s;h=fe894c3b95e3d154264c2f8731b668c410131f01;hb=HEAD)

It's in u-boot-imx tree.

 
  Yes, it can go both ways.
 
 For the SoC I understand. But he PHYs on the Freescale don't, as
 far as I know.
 Anyway, the Denx module probably uses more advanced PHYs.

Different one, I dunno if it's more advanced or not.

 
  The PHY doesn't supply clock on mx28evk, CPU does.
 
 I'm glad we agree here.
 
  Yea ...
  
  M28EVK: PHY supplies clock to CPU
  MX28EVK: CPU supplies clock to PHY
 
 It's getting rather obvious, now you've given me a bit of insight in the
 differences between both boards. Thanks.

You're welcome

 
  Still, the support is already there.
 
 I figured that too; I expected you probably made that first before moving
 on to the Denx module.

Fabio did (Cced), after DENX module was supported.

Please always Cc the mailing list etc.

 But I couldn't find it.
 At first I thought m28evk_config would support it (too). The similarity in
 names suggests similarity in boards. But after patching too much code,
 I figured to implement mx28evk_config and board/freescale/mx28evk
 myself. What a waste of time At least it was a good exercise before
 our product boards arrive next week.
 
 I just pulled my git repository and Make can't find a rule to make
 mx28evk_config, so it's really not there. Not even hidden in another
 configuration.
 
 Wasn't it removed, since the Freescale implementation in 2009.08
 broke?

No, see above.

M
 
 Robert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARMV7: Add support for TRATS board

2012-01-06 Thread Wolfgang Denk
Dear HeungJun, Kim,

In message 00bc0173$83da7820$8b8f6860$%k...@samsung.com you wrote:
 
 This is related with this:
 http://lists.denx.de/pipermail/u-boot/2012-January/114710.html

Arghh... You should not need to include such information.  Proper mail
threading isall we need.  But we really need it.

 And, I prepared version 2 patch modified with:
  1) sorting the list of the name in MAINTAINERS
  2) modifying to GPLv2+
  3) change assem code in lowlevel_init.S to C code in lowlevel_util.c
  4) do not defile values for variables if the variable is feature
  5) Remove miscellaneouses.

Arghhh again.  Please stick to the rules.  The change log MUST be part
of the patch submission itself.  For details please see
http://www.denx.de/wiki/view/U-Boot/Patches#Sending_updated_patch_versions

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A star captain's most solemn oath is that he will give his life, even
his entire crew, rather than violate the Prime Directive.
-- Kirk, The Omega Glory, stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/9] Fix strict-aliasing warning in dlmalloc

2012-01-06 Thread Wolfgang Denk
Dear Simon,

In message capnjgz1oxjjsseodsm-fqtn791mw-uezqwjflqbas-4rbfh...@mail.gmail.com 
you wrote:
 
  Can you please tell me at least one board configuration that throws
  this error (preferrably ppc, arm or mips) ?
 
 I can't see one with those architectures. It does happen for others though:
...

Strange.  Both MIPS and PPC build without a single warning for me.

I cannot test avr32 or m68k here.

  Also, at least one for the mpc5xxx: Fix strict-aliasing warnings in
  usb_ohci.c and ppc4xx: Fix strict-aliasing warnings in usb_ohci.c
  patches?

None here.

I am tempted to blame your tool chain for the problems.

Is anybody else seing these warnings? With which tool chain versions?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If you fail to plan, plan to fail.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Secure update of uboot devices?

2012-01-06 Thread Kim Phillips
On Fri, 30 Dec 2011 13:37:47 +0100
Wolfgang Denk w...@denx.de wrote:

 Dear Andreas,
 
 In message 
 CAB+EkH4j-UoUyHb=XgDbGRncX=oq6+3+mnjwstiuojooyuc...@mail.gmail.com you 
 wrote:
 
  sha1sum sum is yes enough to verify that no files have been modified on the
  file system on the already installed Linux device.
 
 It is also good enough to ensure that the files on any distribution
 media have not been corrupted or modified in some way.  Of course it
 dies not protect against intentional modifications.
 
  But my case here is if one need to update the software on the device out
  somewhere in the world we have now made a usb stick and uboot looks for
  special files first on the usb stick before it continues normal boot. How
  can one ensure that the software on the usb stick is not altered on the way
  to include some additional unwanted features?
 
 You cannot.  Actually you would have to insure first that the U-Boot
 running on that system has not been tampered with.  If I were to
 attack such a system, I'd probably first install (or otherwise run) a
 version of U-boot that has any such security checks disabled or
 removed.

That depends on your hardware.  SoCs with Freescale SEC v4+ h/w can
enable a trusted boot mode after writing a private key to
special-purpose on-chip key memory and subsequently blowing a fuse.
The trusted boot mode ensures a continuous root of trust by booting
an initial (u-)bootloader from on-chip firmware that verifies the
authenticity of the u-boot image it loads before executing it.  The
initial bootloader is written in a similar fashion to the private
key of the chip, and similarly can never be overwritten.  Subsequent
loads, e.g., u-boot-kernel, kernel-app, are free to inherit that
same root of trust.

The Freescale BSP version of u-boot includes some of Freescale's
secure boot work [1], but since then it's been modified to use the
dedicated crypto unit to do the crypto and therefore boot much
faster. Ideally u-boot would be modified to use either s/w or h/w
crypto, but unfortunately I haven't had the time to look into it.

Kim

[1] I don't know where to find the latest that uses the h/w to do
the crypto right now, but there's some s/w crypto based code
available here:

http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/log/

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 0/28] Create generic board init for ARM, x86, PPC

2012-01-06 Thread Simon Glass
This series creates a generic board.c implementation which contains
the essential functions of the major arch/xxx/lib/board.c files.

What is the motivation for this change?

1. There is a lot of repeated code in the board.c files. Any change to
things like setting up the baud rate requires a change in 10 separate
places.

2. Since there are 10 separate files, adding a new feature which requires
initialisation is painful since it must be independently added in 10
places.

3. As time goes by the architectures naturely diverge since there is limited
pressure to compare features or even CONFIG options against simiilar things
in other board.c files.

4. New architectures must implement all the features all over again, and
sometimes in subtley different ways. This places an unfair burden on getting
a new architecture fully functional and running with U-Boot.

5. While it is a bit of a tricky change, I believe it is worthwhile and
achievable. There is no requirement that all code be common, only that
the code that is common should be located in common/board.c rather than
arch/xxx/lib/board.c.

All the functions of board_init_f() and board_init_r() are broken into
separate function calls so that they can easily be included or excluded
for a particular architecture. It also makes it easier to adopt Graeme's
initcall proposal when it is ready.

http://lists.denx.de/pipermail/u-boot/2012-January/114499.html

This series removes the dependency on generic relocation. So relocation
happens as one big chunk and is still completely arch-specific. See the
relocation series for a proposed solution to this for ARM:

http://lists.denx.de/pipermail/u-boot/2011-December/112928.html

or Graeme's recent x86 series v2:

http://lists.denx.de/pipermail/u-boot/2012-January/114467.html

Instead of moving over a whole architecture, this series takes the approach
of simply enabling generic board support for an architecture. It is then up
to each board to opt in by defining CONFIG_SYS_GENERIC_BOARD in the board
config file. If this is not done, then the code will be generated as
before. This allows both sets of code to co-exist until we are comfortable
with the generic approach, and enough boards run.

ARM is a relatively large board.c file and one which I can test, therefore
I think it is a good target for this series. On the other hand, x86 is
relatively small and simple, but different enough that it introduces a
few issues to be solved. So I have chosen both ARM and x86 for this series.
After a suggestion from Wolfgang I have added PPC also. This is the
largest and most feature-full board, so hopefully we have all bases
covered in this RFC.

A generic global_data structure is also required. This might upset a few
people. Here is my basic reasoning: most fields are the same, all
architectures include and need it, most global_data.h files already have
 #ifdefs to select fields for a particular SOC, so it is hard to
see why architecures are different in this area. We can perhaps add a
way to put architecture-specific fields into a separate header file, but
for now I have judged that to be counter-productive.

Similarly we need a generic bd_info structure, since generic code will
be accessing it. I have done this in the same way as global_data and the
same comments apply.

There was dicussion on the list about passing gd_t around as a parameter
to pre-relocation init functions. I think this makes sense, but it can
be done as a separate change, and this series does not require it.

While this series needs to stand on its own (as with the link script
cleanup series and the generic relocation series) the goal is the
unification of the board init code. So I hope we can address issues with
this in mind, rather than focusing too narrowly on particular ARM, x86 or
PPC issues.

I have run-tested ARM on Tegra Seaboard only. To try it out, define
CONFIG_SYS_GENERIC_BOARD in your board file and rebuild. Most likely on
x86 and PPC at least it will hang, but if you are lucky it will print
something first :-)

I have run this though MAKEALL with CONFIG_SYS_GENERIC_BOARD on for all
ARM, PPC and x86 boards. There are a few failures, some due to errors in
the board config, some due to things that need fixing. I will address
these with the final series if required.

Note: the first group of commits are required for this series to build,
but could be separated out if required. I have included them here for
convenience.

Comments welcome.

Changes in v2:
- Change generic board to an opt-in system on a per-board basic
- Add CONFIG_SYS_GENERIC_BOARD to allow board to select generic board
- Add PowerPC support
- Rebase to master

Simon Glass (28):
  arm: Change board baud_rate to ulong
  x86: Change board baud_rate to ulong
  arm: Only display frame buffer info if there is LCD/video support
  x86: Remove compiler warning in sc520_timer.c
  x86: Remove dead code in eNET
  x86: Add initial memory barrier macros
  ppc: Add initial memory barrier macros
  

[U-Boot] [RFC PATCH v2 01/28] arm: Change board baud_rate to ulong

2012-01-06 Thread Simon Glass
This is a ulong for some architectures and just unsigned for others.
Change ARM to be consistent.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/include/asm/u-boot.h |2 +-
 common/cmd_bdinfo.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h
index f30b9fc..df1c7c6 100644
--- a/arch/arm/include/asm/u-boot.h
+++ b/arch/arm/include/asm/u-boot.h
@@ -37,7 +37,7 @@
 #define _U_BOOT_H_ 1
 
 typedef struct bd_info {
-intbi_baudrate;/* serial console baudrate */
+   unsigned long   bi_baudrate;/* serial console baudrate */
 unsigned long  bi_ip_addr; /* IP Address */
 ulong  bi_arch_number; /* unique id for this board */
 ulong  bi_boot_params; /* where this board expects params */
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 67cb0da..ddb0afc 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -361,7 +361,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
print_eth(0);
printf(ip_addr = %pI4\n, bd-bi_ip_addr);
 #endif
-   printf(baudrate= %d bps\n, bd-bi_baudrate);
+   printf(baudrate= %ld bps\n, bd-bi_baudrate);
 #if !(defined(CONFIG_SYS_ICACHE_OFF)  defined(CONFIG_SYS_DCACHE_OFF))
print_num(TLB addr, gd-tlb_addr);
 #endif
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 02/28] x86: Change board baud_rate to ulong

2012-01-06 Thread Simon Glass
This is a ulong for some architectures and just unsigned for others.
Change x86 to be consistent.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/x86/include/asm/u-boot.h |2 +-
 common/cmd_bdinfo.c   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index 26450eb..dd42209 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -49,7 +49,7 @@ typedef struct bd_info {
unsigned short  bi_ethspeed;/* Ethernet speed in Mbps */
unsigned long   bi_intfreq; /* Internal Freq, in MHz */
unsigned long   bi_busfreq; /* Bus Freq, in MHz */
-   unsigned intbi_baudrate;/* Console Baudrate */
+   unsigned long   bi_baudrate;/* Console Baudrate */
unsigned long   bi_boot_params; /* where this board expects params */
struct  /* RAM configuration */
{
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index ddb0afc..ac8e78d 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -422,7 +422,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
printf(ip_addr = %pI4\n, bd-bi_ip_addr);
print_mhz(ethspeed,   bd-bi_ethspeed);
 #endif
-   printf(baudrate= %d bps\n, bd-bi_baudrate);
+   printf(baudrate= %ld bps\n, bd-bi_baudrate);
 
return 0;
 }
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 05/28] x86: Remove dead code in eNET

2012-01-06 Thread Simon Glass
This avoids a compiler warning about unused variables.

Signed-off-by: Simon Glass s...@chromium.org
---

 board/eNET/eNET.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/board/eNET/eNET.c b/board/eNET/eNET.c
index 429fe1b..2f26470 100644
--- a/board/eNET/eNET.c
+++ b/board/eNET/eNET.c
@@ -178,11 +178,6 @@ void show_boot_progress(int val)
 
 int last_stage_init(void)
 {
-   int minor;
-   int major;
-
-   major = minor = 0;
-
outb(0x00, LED_LATCH_ADDRESS);
 
register_timer_isr(enet_timer_isr);
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 06/28] x86: Add initial memory barrier macros

2012-01-06 Thread Simon Glass
These are available on other architectures, so add them on x86.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/x86/include/asm/io.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 9b757d4..b12bdd8 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -234,4 +234,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
return (phys_addr_t)(vaddr);
 }
 
+/*
+ * TODO: The kernel offers some more advanced versions of barriers, it might
+ * have some advantages to use them instead of the simple one here.
+ */
+#define dmb()  __asm__ __volatile__ ( : : : memory)
+#define __iormb()  dmb()
+#define __iowmb()  dmb()
+
 #endif
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 10/28] Introduce generic link symbol file

2012-01-06 Thread Simon Glass
We create a separate header file for link symbols defined by the link
scripts. It is helpful to have these all in one place and try to
make them common across architectures. Since Linux already has a similar
file, we bring this in even though many of the symbols there are not
relevant to us.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/asm-generic/sections.h |  124 
 1 files changed, 124 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/sections.h

diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
new file mode 100644
index 000..62c68f0
--- /dev/null
+++ b/include/asm-generic/sections.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * 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
+ */
+
+/* Taken from Linux kernel */
+
+#ifndef _ASM_GENERIC_SECTIONS_H_
+#define _ASM_GENERIC_SECTIONS_H_
+
+/* References to section boundaries */
+
+extern char _text[], _stext[], _etext[];
+extern char _data[], _sdata[], _edata[];
+extern char __bss_start[], __bss_stop[];
+extern char __init_begin[], __init_end[];
+extern char _sinittext[], _einittext[];
+extern char _end[];
+extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
+extern char __kprobes_text_start[], __kprobes_text_end[];
+extern char __entry_text_start[], __entry_text_end[];
+extern char __initdata_begin[], __initdata_end[];
+extern char __start_rodata[], __end_rodata[];
+
+/* Start and end of .ctors section - used for constructor calls. */
+extern char __ctors_start[], __ctors_end[];
+
+/* function descriptor handling (if any).  Override
+ * in asm/sections.h */
+#ifndef dereference_function_descriptor
+#define dereference_function_descriptor(p) (p)
+#endif
+
+/* random extra sections (if any).  Override
+ * in asm/sections.h */
+#ifndef arch_is_kernel_text
+static inline int arch_is_kernel_text(unsigned long addr)
+{
+   return 0;
+}
+#endif
+
+#ifndef arch_is_kernel_data
+static inline int arch_is_kernel_data(unsigned long addr)
+{
+   return 0;
+}
+#endif
+
+#include elf.h
+
+/* U-Boot-specific things begin here */
+
+/* Start of U-Boot text region */
+extern char __text_start[];
+
+/* This marks the end of the text region which must be relocated */
+extern char __image_copy_end[];
+
+/*
+ * This is the U-Boot entry point - prior to relocation it should be same
+ * as __text_start
+ */
+extern void _start(void);
+
+/*
+ * ARM needs to use offsets for symbols, since the values of some symbols
+ * are not resolved prior to relocation (and are just 0). Maybe this can be
+ * resolved, or maybe other architectures are similar, iwc this should be
+ * promoted to an architecture option.
+ */
+#ifdef CONFIG_ARM
+#define CONFIG_SYS_SYM_OFFSETS
+#endif
+
+#ifdef CONFIG_SYS_SYM_OFFSETS
+/* Start/end of the relocation entries, as an offset from _start */
+extern ulong _rel_dyn_start_ofs;
+extern ulong _rel_dyn_end_ofs;
+
+/* Start/end of the relocation symbol table, as an offset from _start */
+extern ulong _dynsym_start_ofs;
+
+/* End of the region to be relocated, as an offset form _start */
+extern ulong _image_copy_end_ofs;
+
+extern ulong _bss_start_ofs;   /* BSS start relative to _start */
+extern ulong _bss_end_ofs; /* BSS end relative to _start */
+extern ulong _end_ofs; /* end of image relative to _start */
+
+extern ulong _TEXT_BASE;   /* code start */
+
+#else /* don't use offsets: */
+
+/* Exports from the Linker Script */
+extern ulong __data_end;
+extern ulong __rel_dyn_start;
+extern ulong __rel_dyn_end;
+extern ulong __bss_end;
+
+extern ulong _TEXT_BASE;   /* code start */
+
+#endif
+
+/* Some link scripts put a double underscore on the end, so for now... */
+#define __bss_end__ __bss_end
+
+#endif /* _ASM_GENERIC_SECTIONS_H_ */
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 03/28] arm: Only display frame buffer info if there is LCD/video support

2012-01-06 Thread Simon Glass
This value has no meaning otherwise.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/cmd_bdinfo.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index ac8e78d..cdc595e 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -369,7 +369,9 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
print_num(reloc off, gd-reloc_off);
print_num(irq_sp, gd-irq_sp);/* irq stack pointer */
print_num(sp start , gd-start_addr_sp);
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
print_num(FB base  , gd-fb_base);
+#endif
return 0;
 }
 
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 04/28] x86: Remove compiler warning in sc520_timer.c

2012-01-06 Thread Simon Glass
Removes 'set but not used' warning.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/x86/cpu/sc520/sc520_timer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/cpu/sc520/sc520_timer.c b/arch/x86/cpu/sc520/sc520_timer.c
index 495a694..7f812dc 100644
--- a/arch/x86/cpu/sc520/sc520_timer.c
+++ b/arch/x86/cpu/sc520/sc520_timer.c
@@ -81,7 +81,7 @@ void sc520_udelay(unsigned long usec)
long temp;
 
temp = readw(sc520_mmcr-swtmrmilli);
-   temp = readw(sc520_mmcr-swtmrmicro);
+   temp += readw(sc520_mmcr-swtmrmicro);
 
do {
m += readw(sc520_mmcr-swtmrmilli);
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 12/28] x86: Change stub example to use asm-generic/sections.h

2012-01-06 Thread Simon Glass
We can use the declarations of __bss_start and _end from this header
instead of declaring them locally.

Signed-off-by: Simon Glass s...@chromium.org
---

 examples/standalone/stubs.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c
index a6add6a..aa1a7a6 100644
--- a/examples/standalone/stubs.c
+++ b/examples/standalone/stubs.c
@@ -203,16 +203,15 @@ void __attribute__((unused)) dummy(void)
 #include _exports.h
 }
 
-extern unsigned long __bss_start, _end;
+#include asm-generic/sections.h
 
 void app_startup(char * const *argv)
 {
-   unsigned char * cp = (unsigned char *) __bss_start;
+   char *cp = __bss_start;
 
/* Zero out BSS */
-   while (cp  (unsigned char *)_end) {
+   while (cp  _end)
*cp++ = 0;
-   }
 
 #if defined(CONFIG_X86)
/* x86 does not have a dedicated register for passing global_data */
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 07/28] ppc: Add initial memory barrier macros

2012-01-06 Thread Simon Glass
These are available on other architectures, so add them on ppc.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/powerpc/include/asm/io.h |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
index 56ac9fe..d246fd8 100644
--- a/arch/powerpc/include/asm/io.h
+++ b/arch/powerpc/include/asm/io.h
@@ -318,4 +318,12 @@ static inline phys_addr_t virt_to_phys(void * vaddr)
 #endif
 }
 
+/*
+ * TODO: The kernel offers some more advanced versions of barriers, it might
+ * have some advantages to use them instead of the simple one here.
+ */
+#define dmb()  __asm__ __volatile__ ( : : : memory)
+#define __iormb()  dmb()
+#define __iowmb()  dmb()
+
 #endif
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 13/28] Introduce a basic initcall implementation

2012-01-06 Thread Simon Glass
This library supports calling a list of functions one after the
other.

It is intended that we move to a more powerful initcall implementation
as proposed by Graeme Russ graeme.r...@gmail.com. For now, this allows
us to do the basics.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/initcall.h |   25 +
 lib/Makefile   |1 +
 lib/initcall.c |   41 +
 3 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100644 include/initcall.h
 create mode 100644 lib/initcall.c

diff --git a/include/initcall.h b/include/initcall.h
new file mode 100644
index 000..9e54fa5
--- /dev/null
+++ b/include/initcall.h
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ *
+ * 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
+ */
+
+typedef int (*init_fnc_t)(void);
+
+int initcall_run_list(init_fnc_t init_sequence[]);
diff --git a/lib/Makefile b/lib/Makefile
index 35ba7ff..1625115 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -40,6 +40,7 @@ COBJS-y += display_options.o
 COBJS-y += errno.o
 COBJS-$(CONFIG_OF_CONTROL) += fdtdec.o
 COBJS-$(CONFIG_GZIP) += gunzip.o
+COBJS-y += initcall.o
 COBJS-y += hashtable.o
 COBJS-$(CONFIG_LMB) += lmb.o
 COBJS-y += ldiv.o
diff --git a/lib/initcall.c b/lib/initcall.c
new file mode 100644
index 000..b11048e
--- /dev/null
+++ b/lib/initcall.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2002-2006
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH www.elinos.com
+ * Marius Groeger mgroe...@sysgo.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 initcall.h
+
+int initcall_run_list(init_fnc_t init_sequence[])
+{
+   init_fnc_t *init_fnc_ptr;
+
+   for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
+   if ((*init_fnc_ptr)())
+   return -1;
+   }
+   return 0;
+}
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 11/28] arm: Use sections header to obtain link symbols

2012-01-06 Thread Simon Glass
Include this header to get access to link symbols, which are otherwise
removed.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/include/asm/u-boot-arm.h |4 
 arch/arm/lib/board.c  |1 +
 board/cm4008/flash.c  |1 +
 board/cm41xx/flash.c  |1 +
 4 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/include/asm/u-boot-arm.h 
b/arch/arm/include/asm/u-boot-arm.h
index 4ca75f9..7cfae9b 100644
--- a/arch/arm/include/asm/u-boot-arm.h
+++ b/arch/arm/include/asm/u-boot-arm.h
@@ -30,12 +30,8 @@
 #define _U_BOOT_ARM_H_ 1
 
 /* for the following variables, see start.S */
-extern ulong _bss_start_ofs;   /* BSS start relative to _start */
-extern ulong _bss_end_ofs; /* BSS end relative to _start */
-extern ulong _end_ofs; /* end of image relative to _start */
 extern ulong IRQ_STACK_START;  /* top of IRQ stack */
 extern ulong FIQ_STACK_START;  /* top of FIQ stack */
-extern ulong _TEXT_BASE;   /* code start */
 extern ulong _datarel_start_ofs;
 extern ulong _datarelrolocal_start_ofs;
 extern ulong _datarellocal_start_ofs;
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 3d78274..a95edb8 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -39,6 +39,7 @@
  */
 
 #include common.h
+#include asm-generic/sections.h
 #include command.h
 #include malloc.h
 #include stdio_dev.h
diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
index 5522bf0..641d46f 100644
--- a/board/cm4008/flash.c
+++ b/board/cm4008/flash.c
@@ -28,6 +28,7 @@
  */
 
 #include common.h
+#include asm-generic/sections.h
 #include linux/byteorder/swab.h
 
 
diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
index 5522bf0..641d46f 100644
--- a/board/cm41xx/flash.c
+++ b/board/cm41xx/flash.c
@@ -28,6 +28,7 @@
  */
 
 #include common.h
+#include asm-generic/sections.h
 #include linux/byteorder/swab.h
 
 
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 18/28] arm: Enable generic board support

2012-01-06 Thread Simon Glass
This enables generic board support so that ARM boards can define
CONFIG_SYS_GENERIC_BOARD.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/config.mk |3 ---
 arch/arm/include/asm/global_data.h |7 +++
 arch/arm/include/asm/u-boot.h  |9 +
 arch/arm/lib/Makefile  |4 +++-
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 31e9ef9..45f9dca 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -33,9 +33,6 @@ endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
-# Move to unified board system later
-CONFIG_SYS_LEGACY_BOARD := y
-
 # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
 PF_CPPFLAGS_ARM := $(call cc-option,-marm,)
 
diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index c3ff789..aced4fe 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -23,6 +23,11 @@
 
 #ifndef__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
+
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified global_data */
+#include asm-generic/global_data.h
+#else
 /*
  * The following data structure is placed in some memory which is
  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
@@ -98,6 +103,8 @@ typedef  struct  global_data {
 #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in  out)   
*/
 #define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
 
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm (r8)
 
 #endif /* __ASM_GBL_DATA_H */
diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h
index df1c7c6..c6290ef 100644
--- a/arch/arm/include/asm/u-boot.h
+++ b/arch/arm/include/asm/u-boot.h
@@ -36,6 +36,12 @@
 #ifndef _U_BOOT_H_
 #define _U_BOOT_H_ 1
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include asm-generic/u-boot.h
+#else
+
+#ifndef __ASSEMBLY__
 typedef struct bd_info {
unsigned long   bi_baudrate;/* serial console baudrate */
 unsigned long  bi_ip_addr; /* IP Address */
@@ -47,6 +53,9 @@ typedef struct bd_info {
ulong size;
 }  bi_dram[CONFIG_NR_DRAM_BANKS];
 } bd_t;
+#endif
+
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
 
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_ARM
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 300c8fa..11cfc00 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -37,7 +37,9 @@ GLSOBJS   += _umodsi3.o
 
 GLCOBJS+= div0.o
 
-COBJS-y+= board.o
+ifeq ($(CONFIG_SYS_GENERIC_BOARD),)
+COBJS-y += board.o
+endif
 COBJS-y+= bootm.o
 COBJS-y+= cache.o
 COBJS-y+= cache-cp15.o
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 15/28] Introduce generic pre-relocation board_f.c

2012-01-06 Thread Simon Glass
This file handles common pre-relocation init for boards which use
the generic framework.

It starts up the console, DRAM, performs relocation and then jumps
to post-relocation init.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/Makefile  |3 +
 common/board_f.c |  490 ++
 2 files changed, 493 insertions(+), 0 deletions(-)
 create mode 100644 common/board_f.c

diff --git a/common/Makefile b/common/Makefile
index 2d9ae8c..3e9967b 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -36,6 +36,9 @@ COBJS-y += s_record.o
 COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
 COBJS-y += xyzModem.o
 
+# boards
+COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
+
 # core command
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTM) += cmd_bootm.o
diff --git a/common/board_f.c b/common/board_f.c
new file mode 100644
index 000..ef24bc0
--- /dev/null
+++ b/common/board_f.c
@@ -0,0 +1,490 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2002-2006
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH www.elinos.com
+ * Marius Groeger mgroe...@sysgo.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 linux/compiler.h
+#include version.h
+#include asm-generic/sections.h
+#include asm/io.h
+#include environment.h
+#include initcall.h
+#include logbuff.h
+#include post.h
+
+/*
+ * Pointer to initial global data area
+ *
+ * Here we initialize it if needed.
+ */
+#ifdef XTRN_DECLARE_GLOBAL_DATA_PTR
+#undef XTRN_DECLARE_GLOBAL_DATA_PTR
+#define XTRN_DECLARE_GLOBAL_DATA_PTR   /* empty = allocate here */
+DECLARE_GLOBAL_DATA_PTR = (gd_t *) (CONFIG_SYS_INIT_GD_ADDR);
+#else
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
+/* TODO: Move to header file */
+int print_cpuinfo(void);
+
+/*
+ * sjg: IMO this code should be
+ * refactored to a single function, something like:
+ *
+ * void led_set_state(enum led_colour_t colour, int on);
+ */
+/
+ * Coloured LED functionality
+ 
+ * May be supplied by boards if desired
+ */
+inline void __coloured_LED_init(void) {}
+void coloured_LED_init(void)
+   __attribute__((weak, alias(__coloured_LED_init)));
+inline void __red_led_on(void) {}
+void red_led_on(void) __attribute__((weak, alias(__red_led_on)));
+inline void __red_led_off(void) {}
+void red_led_off(void) __attribute__((weak, alias(__red_led_off)));
+inline void __green_led_on(void) {}
+void green_led_on(void) __attribute__((weak, alias(__green_led_on)));
+inline void __green_led_off(void) {}
+void green_led_off(void) __attribute__((weak, alias(__green_led_off)));
+inline void __yellow_led_on(void) {}
+void yellow_led_on(void) __attribute__((weak, alias(__yellow_led_on)));
+inline void __yellow_led_off(void) {}
+void yellow_led_off(void) __attribute__((weak, alias(__yellow_led_off)));
+inline void __blue_led_on(void) {}
+void blue_led_on(void) __attribute__((weak, alias(__blue_led_on)));
+inline void __blue_led_off(void) {}
+void blue_led_off(void) __attribute__((weak, alias(__blue_led_off)));
+
+/*
+ * Why is gd allocated a register? Prior to reloc it might be better to
+ * just pass it around to each function in this file?
+ *
+ * After reloc one could argue that it is hardly used and doesn't need
+ * to be in a register. Or if it is it should perhaps hold pointers to all
+ * global data for all modules, so that post-reloc we can avoid the massive
+ * literal pool we get on ARM. Or perhaps just encourage each module to use
+ * a structure...
+ */
+
+/*
+ * Could the CONFIG_SPL_BUILD infection become a flag in gd?
+ */
+
+static int init_baud_rate(void)
+{
+   gd-baudrate = getenv_ulong(baudrate, 10, CONFIG_BAUDRATE);
+   return 0;
+}
+
+static int display_text_info(void)
+{
+   ulong bss_start, bss_end;
+
+   bss_start = _bss_start_ofs + _TEXT_BASE;
+   bss_end = _bss_end_ofs + _TEXT_BASE;
+   debug(U-Boot code: %08X - %08lX  BSS: - %08lX\n,
+ CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
+
+#ifdef CONFIG_MODEM_SUPPORT
+   

[U-Boot] [RFC PATCH v2 08/28] Introduce generic global_data

2012-01-06 Thread Simon Glass
We want to unify the global_data structure. Most fields are common across
architectures, but there are a fair number of SOC-specific additions. It
isn't clear how best to deal with these, but for now we just use #ifdef.

Checkpatch warnings here might be unavoidable:

warning: include/asm-generic/global_data.h,43: do not add new typedefs
warning: include/asm-generic/global_data.h,117: Use of volatile is usually 
wrong: see Documentation/volatile-considered-harmful.txt
warning: include/asm-generic/global_data.h,121: storage class should be at the 
beginning of the declaration

Signed-off-by: Simon Glass s...@chromium.org
---

 include/asm-generic/global_data.h |  115 +
 1 files changed, 115 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/global_data.h

diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
new file mode 100644
index 000..6199926
--- /dev/null
+++ b/include/asm-generic/global_data.h
@@ -0,0 +1,115 @@
+/*
+ * (C) Copyright 2002-2010
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.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
+ */
+
+#ifndef__ASM_GENERIC_GBL_DATA_H
+#define __ASM_GENERIC_GBL_DATA_H
+/*
+ * The following data structure is placed in some memory which is
+ * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
+ * some locked parts of the data cache) to allow for a minimum set of
+ * global variables during system initialization (until we have set
+ * up the memory controller so that we can use RAM).
+ *
+ * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE  sizeof(gd_t)
+ *
+ * s...@chromium.org: Well it would be nice to have a generic one of these
+ * since so many fields are similar. But it means that everyone architecture
+ * will want to add its own nutty fields. Perhaps that is no bad thing since
+ * it shows up inconsistences and might produce downward pressure on the
+ * number of fields.
+ */
+
+#ifndef __ASSEMBLY__
+typedef struct global_data {
+   bd_t*bd;
+   unsigned long   flags;
+   unsigned long   baudrate;
+#if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
+   unsigned long   fb_base;/* Base address of framebuffer mem */
+#endif
+#if defined(CONFIG_POST) || defined(CONFIG_LOGBUFFER)
+   unsigned long   post_log_word;  /* Record POST activities */
+   unsigned long   post_log_res; /* success of POST test */
+   unsigned long   post_init_f_time;  /* When post_init_f started */
+#endif
+   unsigned long   have_console;   /* serial_init() was called */
+#ifdef CONFIG_PRE_CONSOLE_BUFFER
+   unsigned long   precon_buf_idx; /* Pre-Console buffer index */
+#endif
+   unsigned long   env_addr;   /* Address  of Environment struct */
+   unsigned long   env_valid;  /* Checksum of Environment valid? */
+   /* Here begins ARM-specific things. Needs discussion */
+#ifdef CONFIG_AT91FAMILY
+   /* static data needed by at91's clock.c */
+   unsigned long   cpu_clk_rate_hz;
+   unsigned long   main_clk_rate_hz;
+   unsigned long   mck_rate_hz;
+   unsigned long   plla_rate_hz;
+   unsigned long   pllb_rate_hz;
+   unsigned long   at91_pllb_usb_init;
+#endif
+#ifdef CONFIG_ARM
+   /* static data needed by most of timer.c on ARM platforms */
+   unsigned long   timer_rate_hz;
+   unsigned long   tbl;
+   unsigned long   tbu;
+   unsigned long long  timer_reset_value;
+   unsigned long   lastinc;
+#endif
+#ifdef CONFIG_IXP425
+   unsigned long   timestamp;
+#endif
+   /* TODO: is this the same as relocaddr, or something else? */
+   unsigned long   dest_addr;  /* Post-relocation address of U-Boot */
+   unsigned long   dest_addr_sp;
+   unsigned long   ram_top;/* Top address of RAM used by U-Boot */
+
+   unsigned long   relocaddr;  /* Start address of U-Boot in RAM */
+   phys_size_t ram_size;   /* RAM size */
+   unsigned long   mon_len;/* monitor len */
+   unsigned long   irq_sp; /* irq stack pointer */
+   unsigned long   start_addr_sp;  /* start_addr_stackpointer */
+   unsigned 

[U-Boot] [RFC PATCH v2 20/28] x86: Use sections header to obtain link symbols

2012-01-06 Thread Simon Glass
These are defined in asm-generic/sections.h, so remove them from
architecture-specific files.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/x86/include/asm/u-boot-x86.h |8 
 arch/x86/lib/board.c  |1 +
 2 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/arch/x86/include/asm/u-boot-x86.h 
b/arch/x86/include/asm/u-boot-x86.h
index 755f88a..d3e2f4c 100644
--- a/arch/x86/include/asm/u-boot-x86.h
+++ b/arch/x86/include/asm/u-boot-x86.h
@@ -24,14 +24,6 @@
 #ifndef _U_BOOT_I386_H_
 #define _U_BOOT_I386_H_1
 
-/* Exports from the Linker Script */
-extern ulong __text_start;
-extern ulong __data_end;
-extern ulong __rel_dyn_start;
-extern ulong __rel_dyn_end;
-extern ulong __bss_start;
-extern ulong __bss_end;
-
 /* cpu/.../cpu.c */
 int x86_cpu_init_r(void);
 int cpu_init_r(void);
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index d742fec..b9e9f0a 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -41,6 +41,7 @@
 #include ide.h
 #include serial.h
 #include asm/u-boot-x86.h
+#include asm-generic/sections.h
 #include elf.h
 
 #ifdef CONFIG_BITBANGMII
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 25/28] Adjust board_r.c for PowerPC

2012-01-06 Thread Simon Glass
This adds ppc features to the generic post-relocation board init.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/board_r.c |  463 +-
 1 files changed, 460 insertions(+), 3 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 807aec8..33080e6 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -28,23 +28,84 @@
 
 #include common.h
 #include asm-generic/sections.h
+
+/* TODO: can we just include all these headers whether needed or not? */
+#ifdef CONFIG_ADDR_MAP
+#include asm/mmu.h
+#endif
+#if defined(CONFIG_CMD_BEDBUG)
+#include bedbug/type.h
+#endif
 #ifdef CONFIG_HAS_DATAFLASH
 #include dataflash.h
 #endif
 #include environment.h
+#if defined(CONFIG_CMD_IDE)
+#include ide.h
+#endif
 #include initcall.h
+#ifdef CONFIG_PS2KBD
+#include keyboard.h
+#endif
+#if defined(CONFIG_CMD_KGDB)
+#include kgdb.h
+#endif
 #include logbuff.h
 #include malloc.h
+#ifdef CONFIG_BITBANGMII
+#include miiphy.h
+#endif
 #include mmc.h
 #include nand.h
 #include onenand_uboot.h
+#include scsi.h
 #include serial.h
+#include spi.h
 #include stdio_dev.h
+#include watchdog.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
 ulong monitor_flash_len;
 
+/* TODO: Move this prototype to a header? */
+#ifdef CONFIG_SYS_UPDATE_FLASH_SIZE
+extern int update_flash_size(int flash_size);
+#endif
+
+int __board_flash_wp_on(void)
+{
+   /*
+* Most flashes can't be detected when write protection is enabled,
+* so provide a way to let U-Boot gracefully ignore write protected
+* devices.
+*/
+   return 0;
+}
+
+int board_flash_wp_on(void)
+   __attribute__ ((weak, alias(__board_flash_wp_on)));
+
+void __cpu_secondary_init_r(void)
+{
+}
+
+void cpu_secondary_init_r(void)
+   __attribute__ ((weak, alias(__cpu_secondary_init_r)));
+
+static int initr_secondary_cpu(void)
+{
+   /*
+* after non-volatile devices  environment is setup and cpu code have
+* another round to deal with any initialization that might require
+* full access to the environment or loading of some image (firmware)
+* from a non-volatile device
+*/
+   /* TODO: maybe define this for all archs? */
+   cpu_secondary_init_r();
+
+   return 0;
+}
 
 static int initr_reloc(void)
 {
@@ -73,6 +134,25 @@ static int initr_reloc_global_data(void)
 #else
monitor_flash_len = (ulong)__init_end - gd-dest_addr;
 #endif
+#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
+   /*
+* The gd-cpu pointer is set to an address in flash before relocation.
+* We need to update it to point to the same CPU entry in RAM.
+* TODO: why not just add gd-reloc_ofs?
+*/
+   gd-cpu += gd-dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+#ifdef CONFIG_SYS_EXTRA_ENV_RELOC
+   /*
+* Some systems need to relocate the env_addr pointer early because the
+* location it points to will get invalidated before env_relocate is
+* called.  One example is on systems that might use a L2 or L3 cache
+* in SRAM mode and initialize that cache from SRAM mode back to being
+* a cache in cpu_init_r.
+*/
+   gd-env_addr += gd-dest_addr - CONFIG_SYS_MONITOR_BASE;
+#endif
+   return 0;
 }
 
 #ifdef CONFIG_SERIAL_MULTI
@@ -83,6 +163,27 @@ static int initr_serial(void)
 }
 #endif
 
+#ifdef CONFIG_PPC
+static int initr_trap(void)
+{
+   /*
+* Setup trap handlers
+*/
+   trap_init(gd-dest_addr);
+
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_ADDR_MAP
+static int initr_addr_map(void)
+{
+   init_addr_map();
+
+   return 0;
+}
+#endif
+
 #ifdef CONFIG_LOGBUFFER
 unsigned long logbuffer_base(void)
 {
@@ -104,6 +205,50 @@ static int initr_post_backlog(void)
 }
 #endif
 
+#ifdef CONFIG_SYS_DELAYED_ICACHE
+static int initr_icache_enable(void)
+{
+   return 0;
+}
+#endif
+
+#if defined(CONFIG_SYS_INIT_RAM_LOCK)  defined(CONFIG_E500)
+static int initr_unlock_ram_in_cache(void)
+{
+   unlock_ram_in_cache();  /* it's time to unlock D-cache in e500 */
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_PCI
+static int initr_pci(void)
+{
+   pci_init();
+
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_WINBOND_83C553
+static int initr_w83c553f(void)
+{
+   /*
+* Initialise the ISA bridge
+*/
+   initialise_w83c553f();
+   return 0;
+}
+#endif
+
+static int initr_barrier(void)
+{
+#ifdef CONFIG_PPC
+   /* TODO: Can we not use dmb() macros for this? */
+   asm(sync ; isync);
+#endif
+   return 0;
+}
+
 static int initr_malloc(void)
 {
ulong malloc_start;
@@ -123,13 +268,26 @@ static int initr_announce(void)
 #if !defined(CONFIG_SYS_NO_FLASH)
 static int initr_flash(void)
 {
-   ulong flash_size;
+   ulong flash_size = 0;
+   bd_t *bd = gd-bd;
+   int ok;
 
puts(Flash: );
 
-   flash_size = flash_init();
-   if (flash_size = 0) {
+   if (board_flash_wp_on()) {
+ 

[U-Boot] [RFC PATCH v2 16/28] Introduce generic post-relocation board_r.c

2012-01-06 Thread Simon Glass
This file handles common post-relocation init for boards which use
the generic framework.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/Makefile  |1 +
 common/board_r.c |  401 ++
 2 files changed, 402 insertions(+), 0 deletions(-)
 create mode 100644 common/board_r.c

diff --git a/common/Makefile b/common/Makefile
index 3e9967b..d4a9199 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -38,6 +38,7 @@ COBJS-y += xyzModem.o
 
 # boards
 COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_f.o
+COBJS-$(CONFIG_SYS_GENERIC_BOARD) += board_r.o
 
 # core command
 COBJS-y += cmd_boot.o
diff --git a/common/board_r.c b/common/board_r.c
new file mode 100644
index 000..d63c138
--- /dev/null
+++ b/common/board_r.c
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2002-2006
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH www.elinos.com
+ * Marius Groeger mgroe...@sysgo.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 asm-generic/sections.h
+#ifdef CONFIG_HAS_DATAFLASH
+#include dataflash.h
+#endif
+#include environment.h
+#include initcall.h
+#include logbuff.h
+#include malloc.h
+#include mmc.h
+#include nand.h
+#include onenand_uboot.h
+#include serial.h
+#include stdio_dev.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+ulong monitor_flash_len;
+
+
+static int initr_reloc(void)
+{
+   gd-flags |= GD_FLG_RELOC;  /* tell others: relocation done */
+   return 0;
+}
+
+/*
+ * Some of these functions are needed purely because the functions they
+ * call return void. If we change them to return 0, these stubs can go away.
+ */
+static int initr_caches(void)
+{
+   /* Enable caches */
+   enable_caches();
+   return 0;
+}
+
+static int initr_reloc_global_data(void)
+{
+#ifdef CONFIG_SYS_SYM_OFFSETS
+   monitor_flash_len = _end_ofs;
+#else
+   monitor_flash_len = (ulong)__init_end - gd-dest_addr;
+#endif
+}
+
+#ifdef CONFIG_SERIAL_MULTI
+static int initr_serial(void)
+{
+   serial_initialize();
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_LOGBUFFER
+unsigned long logbuffer_base(void)
+{
+   return gd-ram_top - LOGBUFF_LEN;
+}
+
+static int initr_logbuffer(void)
+{
+   logbuff_init_ptrs();
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_POST
+static int initr_post_backlog(void)
+{
+   post_output_backlog();
+   return 0;
+}
+#endif
+
+static int initr_malloc(void)
+{
+   ulong malloc_start;
+
+   /* The malloc area is immediately below the monitor copy in DRAM */
+   malloc_start = gd-dest_addr - TOTAL_MALLOC_LEN;
+   mem_malloc_init(malloc_start, TOTAL_MALLOC_LEN);
+   return 0;
+}
+
+static int initr_announce(void)
+{
+   debug(Now running in RAM - U-Boot at: %08lx\n, gd-dest_addr);
+   return 0;
+}
+
+#if !defined(CONFIG_SYS_NO_FLASH)
+static int initr_flash(void)
+{
+   ulong flash_size;
+
+   puts(Flash: );
+
+   flash_size = flash_init();
+   if (flash_size = 0) {
+   puts(*** failed ***\n);
+   return -1;
+   }
+   print_size(flash_size, );
+#ifdef CONFIG_SYS_FLASH_CHECKSUM
+   {
+   char *s;
+
+   s = getenv(flashchecksum);
+
+   /*
+   * Compute and print flash CRC if flashchecksum is set to 'y'
+   *
+   * NOTE: Maybe we should add some WATCHDOG_RESET()? XXX
+   */
+   if (s  (*s == 'y')) {
+   printf(  CRC: %08X, crc32(0,
+   (const unsigned char *) CONFIG_SYS_FLASH_BASE,
+   flash_size));
+   }
+   }
+#endif /* CONFIG_SYS_FLASH_CHECKSUM */
+   putc('\n');
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_CMD_NAND
+/* go init the NAND */
+int initr_nand(void)
+{
+   puts(NAND:  );
+   nand_init();
+   return 0;
+}
+#endif
+
+#if defined(CONFIG_CMD_ONENAND)
+/* go init the NAND */
+int initr_onenand(void)
+{
+   puts(NAND:  );
+   onenand_init();
+   return 0;
+}
+#endif
+
+#ifdef CONFIG_GENERIC_MMC
+int initr_mmc(void)
+{
+  

[U-Boot] [RFC PATCH v2 27/28] tegra: Mark board init files for ARMv4t

2012-01-06 Thread Simon Glass
Since Tegra executes early code on an ARMv4T (but the rest on ARMv7)
we must mark the new board init files for compilation with ARMv4t
architecture.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/armv7/tegra2/config.mk |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/config.mk 
b/arch/arm/cpu/armv7/tegra2/config.mk
index 2303dba..4b43dde 100644
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ b/arch/arm/cpu/armv7/tegra2/config.mk
@@ -28,6 +28,8 @@
 # file with compatible flags
 ifdef CONFIG_TEGRA2
 CFLAGS_arch/arm/lib/board.o += -march=armv4t
+CFLAGS_common/board_f.o += -march=armv4t
+CFLAGS_lib/initcall.o += -march=armv4t
 endif
 
 USE_PRIVATE_LIBGCC = yes
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 26/28] ppc: Enable generic board board

2012-01-06 Thread Simon Glass
This enables generic board support so that ppc boards can define
CONFIG_SYS_GENERIC_BOARD.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/powerpc/config.mk |3 ---
 arch/powerpc/include/asm/global_data.h |7 +++
 arch/powerpc/include/asm/u-boot.h  |7 +++
 arch/powerpc/lib/Makefile  |4 +++-
 4 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index e6203dd..a307154 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -29,9 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections 
-fdata-sections
 PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__
 PLATFORM_LDFLAGS  += -n
 
-# Move to unified board system later
-CONFIG_SYS_LEGACY_BOARD := y
-
 #
 # When cross-compiling on NetBSD, we have to define __PPC__ or else we
 # will pick up a va_list declaration that is incompatible with the
diff --git a/arch/powerpc/include/asm/global_data.h 
b/arch/powerpc/include/asm/global_data.h
index 01f1d4a..3200443 100644
--- a/arch/powerpc/include/asm/global_data.h
+++ b/arch/powerpc/include/asm/global_data.h
@@ -27,6 +27,11 @@
 #include config.h
 #include asm/types.h
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified global_data */
+#include asm-generic/global_data.h
+#else
+
 /*
  * The following data structure is placed in some memory wich is
  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
@@ -198,6 +203,8 @@ typedef struct  global_data {
 #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in  out)   
*/
 #define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
 
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 #if 1
 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm (r2)
 #else /* We could use plain global data, but the resulting code is bigger */
diff --git a/arch/powerpc/include/asm/u-boot.h 
b/arch/powerpc/include/asm/u-boot.h
index b2fa2b5..7cc9af7 100644
--- a/arch/powerpc/include/asm/u-boot.h
+++ b/arch/powerpc/include/asm/u-boot.h
@@ -34,6 +34,11 @@
  * include/asm-ppc/u-boot.h
  */
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include asm-generic/u-boot.h
+#else
+
 #ifndef __ASSEMBLY__
 
 typedef struct bd_info {
@@ -144,6 +149,8 @@ typedef struct bd_info {
 
 #endif /* __ASSEMBLY__ */
 
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_PPC
 
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index cdd62a2..eef76b5 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -44,7 +44,9 @@ SOBJS-y   += ticks.o
 SOBJS-y+= reloc.o
 
 COBJS-$(CONFIG_BAT_RW) += bat_rw.o
-COBJS-y+= board.o
+ifeq ($(CONFIG_SYS_GENERIC_BOARD),)
+COBJS-y += board.o
+endif
 COBJS-y+= bootm.o
 COBJS-$(CONFIG_BOOTCOUNT_LIMIT) += bootcount.o
 COBJS-y+= cache.o
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 09/28] Introduce generic u-boot.h file

2012-01-06 Thread Simon Glass
This file holds the board info structure. We need this to be generic
for the unified board series, so create a structure which contains
the basic fields required by the main architectures.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/asm-generic/u-boot.h |  155 ++
 1 files changed, 155 insertions(+), 0 deletions(-)
 create mode 100644 include/asm-generic/u-boot.h

diff --git a/include/asm-generic/u-boot.h b/include/asm-generic/u-boot.h
new file mode 100644
index 000..98a8a21
--- /dev/null
+++ b/include/asm-generic/u-boot.h
@@ -0,0 +1,155 @@
+/*
+ * (C) Copyright 2000 - 2002
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * 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
+ *
+ 
+ * NOTE: This header file defines an interface to U-Boot. Including
+ * this (unmodified) header file in another file is considered normal
+ * use of U-Boot, and does *not* fall under the heading of derived
+ * work.
+ 
+ */
+
+#ifndef __ASM_GENERIC_U_BOOT_H__
+#define __ASM_GENERIC_U_BOOT_H__
+
+/*
+ * Board information passed to Linux kernel from U-Boot
+ *
+ * include/asm-ppc/u-boot.h
+ */
+
+#ifndef __ASSEMBLY__
+
+typedef struct bd_info {
+   unsigned long   bi_memstart;/* start of DRAM memory */
+   phys_size_t bi_memsize; /* size  of DRAM memory in bytes */
+   unsigned long   bi_flashstart;  /* start of FLASH memory */
+   unsigned long   bi_flashsize;   /* size  of FLASH memory */
+   unsigned long   bi_flashoffset; /* reserved area for startup monitor */
+   unsigned long   bi_sramstart;   /* start of SRAM memory */
+   unsigned long   bi_sramsize;/* size  of SRAM memory */
+#if defined(CONFIG_5xx) || defined(CONFIG_8xx) || defined(CONFIG_8260) \
+   || defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
+   unsigned long   bi_immr_base;   /* base of IMMR register */
+#endif
+#if defined(CONFIG_MPC5xxx)
+   unsigned long   bi_mbar_base;   /* base of internal registers */
+#endif
+#if defined(CONFIG_MPC83xx)
+   unsigned long   bi_immrbar;
+#endif
+#if defined(CONFIG_MPC8220)
+   unsigned long   bi_mbar_base;   /* base of internal registers */
+   unsigned long   bi_inpfreq; /* Input Freq, In MHz */
+   unsigned long   bi_pcifreq; /* PCI Freq, in MHz */
+   unsigned long   bi_pevfreq; /* PEV Freq, in MHz */
+   unsigned long   bi_flbfreq; /* Flexbus Freq, in MHz */
+   unsigned long   bi_vcofreq; /* VCO Freq, in MHz */
+#endif
+   unsigned long   bi_bootflags;   /* boot / reboot flag (Unused) */
+   unsigned long   bi_ip_addr; /* IP Address */
+   unsigned char   bi_enetaddr[6]; /* OLD: see README.enetaddr */
+   unsigned short  bi_ethspeed;/* Ethernet speed in Mbps */
+   unsigned long   bi_intfreq; /* Internal Freq, in MHz */
+   unsigned long   bi_busfreq; /* Bus Freq, in MHz */
+#if defined(CONFIG_CPM2)
+   unsigned long   bi_cpmfreq; /* CPM_CLK Freq, in MHz */
+   unsigned long   bi_brgfreq; /* BRG_CLK Freq, in MHz */
+   unsigned long   bi_sccfreq; /* SCC_CLK Freq, in MHz */
+   unsigned long   bi_vco; /* VCO Out from PLL, in MHz */
+#endif
+#if defined(CONFIG_MPC512X)
+   unsigned long   bi_ipsfreq; /* IPS Bus Freq, in MHz */
+#endif /* CONFIG_MPC512X */
+#if defined(CONFIG_MPC5xxx)
+   unsigned long   bi_ipbfreq; /* IPB Bus Freq, in MHz */
+   unsigned long   bi_pcifreq; /* PCI Bus Freq, in MHz */
+#endif
+   unsigned long   bi_baudrate;/* Console Baudrate */
+#if defined(CONFIG_405)   || \
+   defined(CONFIG_405GP) || \
+   defined(CONFIG_405CR) || \
+   defined(CONFIG_405EP) || \
+   defined(CONFIG_405EZ) || \
+   defined(CONFIG_405EX) || \
+   defined(CONFIG_440)
+   unsigned char   bi_s_version[4];/* Version of this structure */
+   unsigned char   bi_r_version[32];   /* Version of the ROM (AMCC) */
+   unsigned intbi_procfreq;/* CPU (Internal) Freq, in Hz */
+   unsigned intbi_plb_busfreq; /* PLB Bus speed, in Hz */
+ 

[U-Boot] [RFC PATCH v2 17/28] Add spl load feature

2012-01-06 Thread Simon Glass
This adds secondary program loader support to the generic board.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/board_f.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index ef24bc0..94f316c 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -305,6 +305,7 @@ static int reserve_uboot(void)
return 0;
 }
 
+#ifndef CONFIG_SPL_BUILD
 /* reserve memory for malloc() area */
 static int reserve_malloc(void)
 {
@@ -324,6 +325,7 @@ static int reserve_board(void)
sizeof(bd_t), gd-dest_addr_sp);
return 0;
 }
+#endif
 
 static int setup_machine(void)
 {
@@ -342,6 +344,7 @@ static int reserve_global_data(void)
return 0;
 }
 
+#ifndef CONFIG_SPL_BUILD
 static int reserve_stacks(void)
 {
/* setup stack pointer for exceptions */
@@ -359,6 +362,17 @@ static int reserve_stacks(void)
 
return 0;
 }
+#endif
+
+#ifdef CONFIG_SPL_BUILD
+static int reserve_stacks_spl(void)
+{
+   /* Why not -= ? */
+   gd-dest_addr_sp += 128;/* leave 32 words for abort-stack */
+   gd-irq_sp = gd-dest_addr_sp;
+   return 0;
+}
+#endif
 
 static int display_new_sp(void)
 {
@@ -458,11 +472,17 @@ static init_fnc_t init_sequence_f[] = {
reserve_lcd,
 #endif
reserve_uboot,
+#ifndef CONFIG_SPL_BUILD
reserve_malloc,
reserve_board,
+#endif
setup_machine,
reserve_global_data,
+#ifdef CONFIG_SPL_BUILD
+   reserve_stacks_spl,
+#else
reserve_stacks,
+#endif
setup_baud_rate,
display_new_sp,
jump_to_copy,
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 14/28] Define CONFIG_SYS_LEGACY_BOARD everywhere

2012-01-06 Thread Simon Glass
We are introducing a new unified board setup and we want this to
be the default. So we need to opt all architectures out first.

Signed-off-by: Simon Glass s...@chromium.org
---

 README|   11 +++
 arch/arm/config.mk|3 +++
 arch/avr32/config.mk  |3 +++
 arch/blackfin/config.mk   |3 +++
 arch/m68k/config.mk   |3 +++
 arch/microblaze/config.mk |3 +++
 arch/mips/config.mk   |3 +++
 arch/nds32/config.mk  |3 +++
 arch/nios2/config.mk  |3 +++
 arch/powerpc/config.mk|3 +++
 arch/sandbox/config.mk|3 +++
 arch/sh/config.mk |3 +++
 arch/sparc/config.mk  |3 +++
 arch/x86/config.mk|3 +++
 config.mk |8 
 15 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/README b/README
index 9d713e8..a9d5a77 100644
--- a/README
+++ b/README
@@ -2744,6 +2744,17 @@ Configuration Settings:
cases. This setting can be used to tune behaviour; see
lib/hashtable.c for details.
 
+- CONFIG_SYS_GENERIC_BOARD
+   This selects the architecture-generic board system instead of the
+   architecture-specific board files. It is intended to move boards
+   to this new framework over time. Defining this will disable the
+   arch/foo/lib/board.c file and use common/board_f.c and
+   common/board_r.c instead. To use this option your architecture
+   must support it (i.e. must NOT define CONFIG_SYS_LEGACY_BOARD in
+   its config.mk file). If you find problems enabling this option on
+   your board please report the problem and send patches!
+
+
 The following definitions that deal with the placement and management
 of environment data (variable area); in general, we support the
 following configurations:
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 45f9dca..31e9ef9 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -33,6 +33,9 @@ endif
 
 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
 PF_CPPFLAGS_ARM := $(call cc-option,-marm,)
 
diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk
index d8e7ebb..6eb00f6 100644
--- a/arch/avr32/config.mk
+++ b/arch/avr32/config.mk
@@ -31,3 +31,6 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 LDFLAGS_u-boot = --gc-sections --relax
 
 LDSCRIPT   = $(SRCTREE)/$(CPUDIR)/u-boot.lds
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 3595aa2..972afb1 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -37,6 +37,9 @@ CONFIG_BFIN_BOOT_MODE := $(strip $(subst 
,,$(CONFIG_BFIN_BOOT_MODE)))
 PLATFORM_RELFLAGS += -ffixed-P3 -fomit-frame-pointer -mno-fdpic
 PLATFORM_CPPFLAGS += -DCONFIG_BLACKFIN
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 LDFLAGS_FINAL += --gc-sections
 LDFLAGS += -m elf32bfin
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk
index 11ba334..11ad9a5 100644
--- a/arch/m68k/config.mk
+++ b/arch/m68k/config.mk
@@ -29,3 +29,6 @@ PLATFORM_CPPFLAGS += -DCONFIG_M68K -D__M68K__
 PLATFORM_LDFLAGS  += -n
 PLATFORM_RELFLAGS  += -ffunction-sections -fdata-sections
 LDFLAGS_FINAL  += --gc-sections
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
index abea70b..119a596 100644
--- a/arch/microblaze/config.mk
+++ b/arch/microblaze/config.mk
@@ -29,3 +29,6 @@ CROSS_COMPILE ?= mb-
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
 
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index 6ab8acd..8f5305e 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -27,6 +27,9 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x8020 -T mips.lds
 
 PLATFORM_CPPFLAGS += -DCONFIG_MIPS -D__MIPS__
 
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
+
 #
 # From Linux arch/mips/Makefile
 #
diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk
index c589829..f989053 100644
--- a/arch/nds32/config.mk
+++ b/arch/nds32/config.mk
@@ -33,3 +33,6 @@ PLATFORM_RELFLAGS += -gdwarf-2
 PLATFORM_CPPFLAGS  += -DCONFIG_NDS32 -D__nds32__ -G0 -ffixed-10 -fpie
 
 LDFLAGS_u-boot = --gc-sections --relax
+
+# Move to unified board system later
+CONFIG_SYS_LEGACY_BOARD := y
diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
index 7b03ed8..0172f70 100644
--- a/arch/nios2/config.mk
+++ b/arch/nios2/config.mk
@@ -31,3 +31,6 @@ PLATFORM_CPPFLAGS += -G0
 
 LDFLAGS_FINAL += --gc-sections
 PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
+
+# Move to unified board system 

[U-Boot] [RFC PATCH v2 21/28] Add x86 fields to generic global_data

2012-01-06 Thread Simon Glass
These fields are needed for x86.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/asm-generic/global_data.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index 6199926..fb976f9 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -44,6 +44,8 @@ typedef struct global_data {
bd_t*bd;
unsigned long   flags;
unsigned long   baudrate;
+   unsigned long   cpu_clk;/* CPU clock in Hz! */
+   unsigned long   bus_clk;
 #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
unsigned long   fb_base;/* Base address of framebuffer mem */
 #endif
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 28/28] tegra: Enable generic board for Seaboard.

2012-01-06 Thread Simon Glass
Enable CONFIG_SYS_GENERIC_BOARD for Tegra 2 Seaboard.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Change generic board to an opt-in system on a per-board basic
- Add CONFIG_SYS_GENERIC_BOARD to allow board to select generic board
- Add PowerPC support
- Rebase to master

 include/configs/seaboard.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 261f952..11d9e8d 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -27,6 +27,8 @@
 #include asm/sizes.h
 #include tegra2-common.h
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /* High-level configuration options */
 #define TEGRA2_SYSMEM  mem=384M@0M nvmem=128M@384M mem=512M@512M
 #define V_PROMPT   Tegra2 (SeaBoard) # 
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 19/28] Add CONFIG_SYS_SYM_OFFSETS to support offset symbols

2012-01-06 Thread Simon Glass
Link symbols as created by the link script can either be absolute or
relative to the text start. This option switches between the two options
so that we can support both.

As we convert architectures over to generic board, we can see if this
option is actually needed, or whether it is possible to unify this feature
also.

Signed-off-by: Simon Glass s...@chromium.org
---

 README   |6 ++
 common/board_f.c |   11 +++
 2 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/README b/README
index a9d5a77..7f853d1 100644
--- a/README
+++ b/README
@@ -2754,6 +2754,12 @@ Configuration Settings:
its config.mk file). If you find problems enabling this option on
your board please report the problem and send patches!
 
+- CONFIG_SYS_SYM_OFFSETS
+   This is set by architectures that use offsets for link symbols
+   instead of absolute values. So bss_start is obtained using an
+   offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
+   directly. You should not need to touch this setting.
+
 
 The following definitions that deal with the placement and management
 of environment data (variable area); in general, we support the
diff --git a/common/board_f.c b/common/board_f.c
index 94f316c..2aa2cf1 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -108,8 +108,13 @@ static int display_text_info(void)
 {
ulong bss_start, bss_end;
 
+#ifdef CONFIG_SYS_SYM_OFFSETS
bss_start = _bss_start_ofs + _TEXT_BASE;
bss_end = _bss_end_ofs + _TEXT_BASE;
+#else
+   bss_start = (ulong)__bss_start;
+   bss_end = (ulong)__bss_end;
+#endif
debug(U-Boot code: %08X - %08lX  BSS: - %08lX\n,
  CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
 
@@ -186,7 +191,11 @@ static int zero_global_data(void)
 
 static int setup_mon_len(void)
 {
+#ifdef CONFIG_SYS_SYM_OFFSETS
gd-mon_len = _bss_end_ofs;
+#else
+   gd-mon_len = (ulong)__bss_end - (ulong)__text_start;
+#endif
return 0;
 }
 
@@ -423,6 +432,7 @@ static int jump_to_copy(void)
 
 static init_fnc_t init_sequence_f[] = {
setup_global_data_ptr,
+   zero_global_data,
setup_fdt,
setup_mon_len,
 #if defined(CONFIG_ARCH_CPU_INIT)
@@ -457,6 +467,7 @@ static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_POST
init_post,
 #endif
+   setup_dram_config,
setup_reloc,
 #if defined(CONFIG_LOGBUFFER)  !defined(CONFIG_ALT_LB_ADDR)
reserve_logbuffer,
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 24/28] Adjust board_f for ppc

2012-01-06 Thread Simon Glass
This adds ppc features to the generic pre-relocation board init.

This is a separate commit so that these features are clearly shown.

Signed-off-by: Simon Glass s...@chromium.org
---

 common/board_f.c |  373 +-
 include/common.h |   16 +++
 2 files changed, 386 insertions(+), 3 deletions(-)

diff --git a/common/board_f.c b/common/board_f.c
index 2aa2cf1..88c3f71 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -31,10 +31,31 @@
 #include version.h
 #include asm-generic/sections.h
 #include asm/io.h
+#ifdef CONFIG_MP
+#include asm/mp.h
+#endif
 #include environment.h
+#if defined(CONFIG_CMD_IDE)
+#include ide.h
+#endif
+#include i2c.h
 #include initcall.h
 #include logbuff.h
+
+/* TODO: Can we move these into arch/ headers? */
+#ifdef CONFIG_8xx
+#include mpc8xx.h
+#endif
+#ifdef CONFIG_5xx
+#include mpc5xx.h
+#endif
+#ifdef CONFIG_MPC5xxx
+#include mpc5xxx.h
+#endif
+
 #include post.h
+#include spi.h
+#include watchdog.h
 
 /*
  * Pointer to initial global data area
@@ -98,6 +119,34 @@ void blue_led_off(void) __attribute__((weak, 
alias(__blue_led_off)));
  * Could the CONFIG_SPL_BUILD infection become a flag in gd?
  */
 
+#if defined(CONFIG_WATCHDOG)
+static int init_func_watchdog_init(void)
+{
+   puts(   Watchdog enabled\n);
+   WATCHDOG_RESET();
+   return 0;
+}
+
+#define INIT_FUNC_WATCHDOG_INITinit_func_watchdog_init,
+
+int init_func_watchdog_reset(void)
+{
+   WATCHDOG_RESET();
+   return 0;
+}
+
+#else
+#define INIT_FUNC_WATCHDOG_INIT
+#endif /* CONFIG_WATCHDOG */
+
+void __board_add_ram_info(int use_default)
+{
+   /* please define platform specific board_add_ram_info() */
+}
+
+void board_add_ram_info(int)
+   __attribute__ ((weak, alias(__board_add_ram_info)));
+
 static int init_baud_rate(void)
 {
gd-baudrate = getenv_ulong(baudrate, 10, CONFIG_BAUDRATE);
@@ -135,6 +184,25 @@ static int announce_dram_init(void)
return 0;
 }
 
+#ifdef CONFIG_PPC
+static int init_func_ram(void)
+{
+#ifdef CONFIG_BOARD_TYPES
+   int board_type = gd-board_type;
+#else
+   int board_type = 0; /* use dummy arg */
+#endif
+
+   gd-ram_size = initdram(board_type);
+
+   if (gd-ram_size  0)
+   return 0;
+
+   puts(*** failed ***\n);
+   return 1;
+}
+#endif
+
 static int display_dram_config(void)
 {
ulong size;
@@ -155,11 +223,24 @@ static int display_dram_config(void)
size = gd-ram_size;
 #endif
 
-   print_size(size, \n);
+   print_size(size, );
+   board_add_ram_info(0);
+   putc('\n');
 
return 0;
 }
 
+ulong get_effective_memsize(void)
+{
+#ifndefCONFIG_VERY_BIG_RAM
+   return gd-ram_size;
+#else
+   /* limit stack to what we can reasonable map */
+   return ((gd-ram_size  CONFIG_MAX_MEM_MAPPED) ?
+   CONFIG_MAX_MEM_MAPPED : gd-ram_size);
+#endif
+}
+
 void __dram_init_banksize(void)
 {
 #if defined(CONFIG_NR_DRAM_BANKS)  defined(CONFIG_SYS_SDRAM_BASE)
@@ -171,10 +252,37 @@ void __dram_init_banksize(void)
 void dram_init_banksize(void)
__attribute__((weak, alias(__dram_init_banksize)));
 
+#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
+static int init_func_i2c(void)
+{
+   puts(I2C:   );
+   i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+   puts(ready\n);
+   return 0;
+}
+#endif
+
+#if defined(CONFIG_HARD_SPI)
+static int init_func_spi(void)
+{
+   puts(SPI:   );
+   spi_init();
+   puts(ready\n);
+   return 0;
+}
+#endif
+
 static int setup_global_data_ptr(void)
 {
-   /* Pointer is writable since we allocated a register for it */
+   /*
+* Pointer is writable since we allocated a register for it.
+* Can we choose one of these two methods instead of offering both?
+*/
+#ifdef CONFIG_SYS_INIT_SP_ADDR
gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR)  ~0x07);
+#else
+   gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
+#endif
 
/* compiler optimization barrier needed for GCC = 3.4 */
dmb();
@@ -182,6 +290,7 @@ static int setup_global_data_ptr(void)
return 0;
 }
 
+__maybe_unused
 static int zero_global_data(void)
 {
memset((void *)gd, '\0', sizeof(gd_t));
@@ -194,7 +303,8 @@ static int setup_mon_len(void)
 #ifdef CONFIG_SYS_SYM_OFFSETS
gd-mon_len = _bss_end_ofs;
 #else
-   gd-mon_len = (ulong)__bss_end - (ulong)__text_start;
+   /* TODO: use (ulong)__bss_end - (ulong)__text_start; ? */
+   gd-mon_len = (ulong)__bss_end__ - CONFIG_SYS_MONITOR_BASE;
 #endif
return 0;
 }
@@ -234,7 +344,22 @@ static int setup_reloc(void)
 */
gd-ram_size -= CONFIG_SYS_MEM_TOP_HIDE;
 #endif
+#ifdef CONFIG_NR_DRAM_BANKS
gd-dest_addr = gd-bd-bi_dram[0].start + gd-bd-bi_dram[0].size;
+#else
+   gd-dest_addr = CONFIG_SYS_SDRAM_BASE + get_effective_memsize();
+#endif
+   gd-ram_top = gd-dest_addr;
+#if 

[U-Boot] [RFC PATCH v2 22/28] x86: Enable generic board support

2012-01-06 Thread Simon Glass
This enables generic board support so that x86 boards can define
CONFIG_SYS_GENERIC_BOARD.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/x86/config.mk |3 ---
 arch/x86/include/asm/global_data.h |7 +++
 arch/x86/include/asm/u-boot.h  |   11 +++
 arch/x86/lib/Makefile  |4 +++-
 common/board_r.c   |5 +
 5 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 7be3036..23cacff 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -48,6 +48,3 @@ NORMAL_LIBGCC = $(shell $(CC) $(CFLAGS) 
-print-libgcc-file-name)
 PREFIXED_LIBGCC = $(OBJTREE)/arch/$(ARCH)/lib/$(shell basename 
$(NORMAL_LIBGCC))
 
 export USE_PRIVATE_LIBGCC=$(shell dirname $(PREFIXED_LIBGCC))
-
-# Move to unified board system later
-CONFIG_SYS_LEGACY_BOARD := y
diff --git a/arch/x86/include/asm/global_data.h 
b/arch/x86/include/asm/global_data.h
index 05a2139..c5df175 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -23,6 +23,11 @@
 
 #ifndef__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
+
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified global_data */
+#include asm-generic/global_data.h
+#else
 /*
  * The following data structure is placed in some memory wich is
  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
@@ -73,6 +78,8 @@ extern gd_t *gd;
 #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in  out)   
*/
 #define GD_FLG_ENV_READY   0x00080 /* Environment imported into hash table 
*/
 
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 #if 0
 #define DECLARE_GLOBAL_DATA_PTR
 #else
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index dd42209..ef8b7d5 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -36,6 +36,13 @@
 #ifndef _U_BOOT_H_
 #define _U_BOOT_H_ 1
 
+#ifdef CONFIG_SYS_GENERIC_BOARD
+/* Use the generic board which requires a unified bd_info */
+#include asm-generic/u-boot.h
+#else
+
+#ifndef __ASSEMBLY__
+
 typedef struct bd_info {
unsigned long   bi_memstart;/* start of DRAM memory */
phys_size_t bi_memsize; /* size  of DRAM memory in bytes */
@@ -58,6 +65,10 @@ typedef struct bd_info {
}bi_dram[CONFIG_NR_DRAM_BANKS];
 } bd_t;
 
+#endif /* __ASSEMBLY__ */
+
+#endif /* nCONFIG_SYS_GENERIC_BOARD */
+
 /* For image.h:image_check_target_arch() */
 #define IH_ARCH_DEFAULT IH_ARCH_I386
 
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index d584aa4..8a6f8eb 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -30,7 +30,9 @@ SOBJS-$(CONFIG_SYS_PCI_BIOS)  += bios_pci.o
 SOBJS-$(CONFIG_SYS_X86_REALMODE)   += realmode_switch.o
 
 COBJS-$(CONFIG_SYS_PC_BIOS)+= bios_setup.o
-COBJS-y+= board.o
+ifeq ($(CONFIG_SYS_GENERIC_BOARD),)
+COBJS-y += board.o
+endif
 COBJS-y+= bootm.o
 COBJS-y+= gcc.o
 COBJS-y+= interrupts.o
diff --git a/common/board_r.c b/common/board_r.c
index d63c138..807aec8 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -56,12 +56,15 @@ static int initr_reloc(void)
  * Some of these functions are needed purely because the functions they
  * call return void. If we change them to return 0, these stubs can go away.
  */
+#ifdef CONFIG_ARM
 static int initr_caches(void)
 {
+   /* TODO: sort out x86 code here */
/* Enable caches */
enable_caches();
return 0;
 }
+#endif
 
 static int initr_reloc_global_data(void)
 {
@@ -232,11 +235,13 @@ static int initr_api(void)
 #endif
 
 /* enable exceptions */
+#ifdef CONFIG_ARM
 static int initr_enable_interrupts(void)
 {
enable_interrupts();
return 0;
 }
+#endif
 
 #ifdef CONFIG_CMD_NET
 static int initr_ethaddr(void)
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RFC PATCH v2 23/28] Add ppc fields to generic global data

2012-01-06 Thread Simon Glass
This adds fields required by PowerPC to the global data.

Signed-off-by: Simon Glass s...@chromium.org
---

 include/asm-generic/global_data.h |  124 +
 1 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index fb976f9..fb2891e 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -46,6 +46,114 @@ typedef struct global_data {
unsigned long   baudrate;
unsigned long   cpu_clk;/* CPU clock in Hz! */
unsigned long   bus_clk;
+#if defined(CONFIG_8xx)
+   unsigned long   brg_clk;
+#endif
+#if defined(CONFIG_CPM2)
+   /* There are many clocks on the MPC8260 - see page 9-5 */
+   unsigned long   vco_out;
+   unsigned long   cpm_clk;
+   unsigned long   scc_clk;
+   unsigned long   brg_clk;
+#ifdef CONFIG_PCI
+   unsigned long   pci_clk;
+#endif
+#endif
+   unsigned long   mem_clk;
+#if defined(CONFIG_MPC83xx)
+   /* There are other clocks in the MPC83XX */
+   u32 csb_clk;
+#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+   defined(CONFIG_MPC834x) || defined(CONFIG_MPC837x)
+   u32 tsec1_clk;
+   u32 tsec2_clk;
+   u32 usbdr_clk;
+#endif
+#if defined(CONFIG_MPC834x)
+   u32 usbmph_clk;
+#endif /* CONFIG_MPC834x */
+#if defined(CONFIG_MPC8315)
+   u32 tdm_clk;
+#endif
+   u32 core_clk;
+   u32 enc_clk;
+   u32 lbiu_clk;
+   u32 lclk_clk;
+   u32 pci_clk;
+#if defined(CONFIG_MPC8308) || defined(CONFIG_MPC831x) || \
+   defined(CONFIG_MPC837x)
+   u32 pciexp1_clk;
+   u32 pciexp2_clk;
+#endif
+#if defined(CONFIG_MPC837x) || defined(CONFIG_MPC8315)
+   u32 sata_clk;
+#endif
+#if defined(CONFIG_MPC8360)
+   u32  mem_sec_clk;
+#endif /* CONFIG_MPC8360 */
+#endif
+#if defined(CONFIG_FSL_ESDHC)
+   u32 sdhc_clk;
+#endif
+#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
+   u32 lbc_clk;
+   void *cpu;
+#endif /* CONFIG_MPC85xx || CONFIG_MPC86xx */
+#if defined(CONFIG_MPC83xx) || defined(CONFIG_MPC85xx) \
+   || defined(CONFIG_MPC86xx)
+   u32 i2c1_clk;
+   u32 i2c2_clk;
+#endif
+#if defined(CONFIG_QE)
+   u32 qe_clk;
+   u32 brg_clk;
+   uint mp_alloc_base;
+   uint mp_alloc_top;
+#endif /* CONFIG_QE */
+#if defined(CONFIG_FSL_LAW)
+   u32 used_laws;
+#endif
+#if defined(CONFIG_E500)
+   u32 used_tlb_cams[(CONFIG_SYS_NUM_TLBCAMS+31)/32];
+#endif
+#if defined(CONFIG_MPC5xxx)
+   unsigned long   ipb_clk;
+   unsigned long   pci_clk;
+#endif
+#if defined(CONFIG_MPC512X)
+   u32 ips_clk;
+   u32 csb_clk;
+   u32 pci_clk;
+#endif /* CONFIG_MPC512X */
+#if defined(CONFIG_MPC8220)
+   unsigned long   bExtUart;
+   unsigned long   inp_clk;
+   unsigned long   pci_clk;
+   unsigned long   vco_clk;
+   unsigned long   pev_clk;
+   unsigned long   flb_clk;
+#endif
+   unsigned long   reset_status;   /* reset status register at boot */
+#if defined(CONFIG_MPC83xx)
+   unsigned long   arbiter_event_attributes;
+   unsigned long   arbiter_event_address;
+#endif
+#if defined(CONFIG_SYS_ALLOC_DPRAM) || defined(CONFIG_CPM2)
+   unsigned intdp_alloc_base;
+   unsigned intdp_alloc_top;
+#endif
+#if defined(CONFIG_4xx)
+   u32  uart_clk;
+#endif /* CONFIG_4xx */
+#if defined(CONFIG_SYS_GT_6426x)
+   unsigned intmirror_hack[16];
+#endif
+#if defined(CONFIG_A3000)  || \
+   defined(CONFIG_HIDDEN_DRAGON)  || \
+   defined(CONFIG_MUSENKI) ||  \
+   defined(CONFIG_SANDPOINT)
+   void *console_addr;
+#endif
 #if defined(CONFIG_LCD) || defined(CONFIG_VIDEO)
unsigned long   fb_base;/* Base address of framebuffer mem */
 #endif
@@ -54,6 +162,22 @@ typedef struct global_data {
unsigned long   post_log_res; /* success of POST test */
unsigned long   post_init_f_time;  /* When post_init_f started */
 #endif
+#ifdef CONFIG_BOARD_TYPES
+   unsigned long   board_type;
+#endif
+#ifdef CONFIG_MODEM_SUPPORT
+   unsigned long do_mdm_init;
+   unsigned long be_quiet;
+#endif
+#if defined(CONFIG_LWMON) || defined(CONFIG_LWMON5)
+   unsigned long kbd_status;
+#endif
+#ifdef CONFIG_SYS_FPGA_COUNT
+   unsigned fpga_state[CONFIG_SYS_FPGA_COUNT];
+#endif
+#if defined(CONFIG_WD_MAX_RATE)
+   unsigned long long wdt_last;/* trace watch-dog triggering rate */
+#endif
unsigned long   have_console;   /* serial_init() was called */
 #ifdef CONFIG_PRE_CONSOLE_BUFFER
unsigned long   precon_buf_idx; /* Pre-Console buffer index */
-- 
1.7.3.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] Remove execute permissions from source files

2012-01-06 Thread Thomas Weber
Signed-off-by: Thomas Weber we...@corscience.de
---
 0 files changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 = 100644 arch/arm/cpu/armv7/imx-common/timer.c
 mode change 100755 = 100644 drivers/fpga/ivm_core.c
 mode change 100755 = 100644 include/lattice.h

diff --git a/arch/arm/cpu/armv7/imx-common/timer.c 
b/arch/arm/cpu/armv7/imx-common/timer.c
old mode 100755
new mode 100644
diff --git a/drivers/fpga/ivm_core.c b/drivers/fpga/ivm_core.c
old mode 100755
new mode 100644
diff --git a/include/lattice.h b/include/lattice.h
old mode 100755
new mode 100644
-- 
1.7.8.1

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] I want to recommend a good website to you

2012-01-06 Thread mike zenon
hey,
have a nice day.
I want to recommend a good website to you,
 they sell all kinds of electronic products such as laptop,
handset,lcd tv,playstation,camera,bicycles.
Now they are holding a promoting sale action to meet Christmas day coming,
they offer competitive price, this promotion will last a month. It is
a good chance,
I hope you can hold of it if you need buy some items. By the way ,

the website is: www.wobuyok1.com
best regards
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot