Re: [PATCH] net: dhcp: allow to set transmitted vendor id

2012-03-07 Thread Jean-Christophe PLAGNIOL-VILLARD
On 18:36 Tue 06 Mar , Enrico Scholz wrote:
 For net boot setups it is useful to submit boot params like server or
 bootfile over dhcp.  To distinguish barebox from e.g. pxe machines, a
 custom vendor id can be sent in dhcp discover/request messages.
 
 E.g. the ISC dhcp server can be configured with
 
 | if substring(option vendor-class-identifier,0,8) = barebox: {
 | next-server 192.168.3.24;
 | server-name 192.168.3.24;
 | option tftp-server-name 192.168.3.24;
 | option root-path = concat(/srv/sysroots/by-mac/,
 |  binary-to-ascii (16, 8, -, substring (hardware, 1, 6)));
 | }
 
 to sent boot params which are valid for barebox hosts only.
like the idea
but the vendor id is barebox and can be overwrite it for each eth device via
param

Best Regards,
J.

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/2 v2] omap: move scale_vcores to omap4_generic

2012-03-07 Thread Sascha Hauer
On Tue, Mar 06, 2012 at 03:26:28PM +0100, Jan Weitzel wrote:
 scale_vcores is used by two boards.
 
 Signed-off-by: Jan Weitzel j.weit...@phytec.de
 ---
 v2: add omap4_ prefix

Applied both. Thanks


 Sascha
 
  arch/arm/boards/panda/lowlevel.c|   33 
 +--
  arch/arm/boards/pcm049/lowlevel.c   |   33 
 +--
  arch/arm/mach-omap/include/mach/omap4-silicon.h |1 +
  arch/arm/mach-omap/omap4_generic.c  |   31 +
  4 files changed, 34 insertions(+), 64 deletions(-)
 
 diff --git a/arch/arm/boards/panda/lowlevel.c 
 b/arch/arm/boards/panda/lowlevel.c
 index 45ea221..8591fff 100644
 --- a/arch/arm/boards/panda/lowlevel.c
 +++ b/arch/arm/boards/panda/lowlevel.c
 @@ -44,37 +44,6 @@ static const struct ddr_regs ddr_regs_400_mhz_2cs = {
   .mr2= 0x4
  };
  
 -#define I2C_SLAVE 0x12
 -
 -static int noinline scale_vcores(void)
 -{
 - unsigned int rev = omap4_revision();
 -
 - /* For VC bypass only VCOREx_CGF_FORCE  is necessary and
 -  * VCOREx_CFG_VOLTAGE  changes can be discarded
 -  */
 - writel(0, OMAP44XX_PRM_VC_CFG_I2C_MODE);
 - writel(0x6026, OMAP44XX_PRM_VC_CFG_I2C_CLK);
 -
 - /* set VCORE1 force VSEL */
 - omap4_power_i2c_send((0x3A55  8) | I2C_SLAVE);
 -
 - /* FIXME: set VCORE2 force VSEL, Check the reset value */
 - omap4_power_i2c_send((0x295B  8) | I2C_SLAVE);
 -
 - /* set VCORE3 force VSEL */
 - switch (rev) {
 - case OMAP4430_ES2_0:
 - omap4_power_i2c_send((0x2961  8) | I2C_SLAVE);
 - break;
 - case OMAP4430_ES2_1:
 - omap4_power_i2c_send((0x2A61  8) | I2C_SLAVE);
 - break;
 - }
 -
 - return 0;
 -}
 -
  static void noinline panda_init_lowlevel(void)
  {
   struct dpll_param core = OMAP4_CORE_DPLL_PARAM_38M4_DDR400;
 @@ -101,7 +70,7 @@ static void noinline panda_init_lowlevel(void)
   omap4_ddr_init(ddr_regs_400_mhz_2cs, core);
  
   /* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
 - scale_vcores();
 + omap4_scale_vcores();
  
   board_init_lowlevel_return();
  }
 diff --git a/arch/arm/boards/pcm049/lowlevel.c 
 b/arch/arm/boards/pcm049/lowlevel.c
 index bea895e..444a394 100644
 --- a/arch/arm/boards/pcm049/lowlevel.c
 +++ b/arch/arm/boards/pcm049/lowlevel.c
 @@ -44,37 +44,6 @@ static const struct ddr_regs ddr_regs_mt42L64M64_3_200_mhz 
 = {
   .mr2= 0x1 /* from elpida 200MHz! */
  };
  
 -#define I2C_SLAVE 0x12
 -
 -static int noinline scale_vcores(void)
 -{
 - unsigned int rev = omap4_revision();
 -
 - /* For VC bypass only VCOREx_CGF_FORCE  is necessary and
 -  * VCOREx_CFG_VOLTAGE  changes can be discarded
 -  */
 - writel(0, OMAP44XX_PRM_VC_CFG_I2C_MODE);
 - writel(0x6026, OMAP44XX_PRM_VC_CFG_I2C_CLK);
 -
 - /* set VCORE1 force VSEL */
 - omap4_power_i2c_send((0x3A55  8) | I2C_SLAVE);
 -
 - /* FIXME: set VCORE2 force VSEL, Check the reset value */
 - omap4_power_i2c_send((0x295B  8) | I2C_SLAVE);
 -
 - /* set VCORE3 force VSEL */
 - switch (rev) {
 - case OMAP4430_ES2_0:
 - omap4_power_i2c_send((0x2961  8) | I2C_SLAVE);
 - break;
 - case OMAP4430_ES2_1:
 - omap4_power_i2c_send((0x2A61  8) | I2C_SLAVE);
 - break;
 - }
 -
 - return 0;
 -}
 -
  static void noinline pcm049_init_lowlevel(void)
  {
   struct dpll_param core = OMAP4_CORE_DPLL_PARAM_19M2_DDR200;
 @@ -89,7 +58,7 @@ static void noinline pcm049_init_lowlevel(void)
   omap4_ddr_init(ddr_regs_mt42L64M64_3_200_mhz, core);
  
   /* Set VCORE1 = 1.3 V, VCORE2 = VCORE3 = 1.21V */
 - scale_vcores();
 + omap4_scale_vcores();
  
   writel(CM_SYS_CLKSEL_19M2, CM_SYS_CLKSEL);
  
 diff --git a/arch/arm/mach-omap/include/mach/omap4-silicon.h 
 b/arch/arm/mach-omap/include/mach/omap4-silicon.h
 index db0dfdf..f8d3396 100644
 --- a/arch/arm/mach-omap/include/mach/omap4-silicon.h
 +++ b/arch/arm/mach-omap/include/mach/omap4-silicon.h
 @@ -175,5 +175,6 @@ struct dpll_param;
  void omap4_ddr_init(const struct ddr_regs *, const struct dpll_param *);
  void omap4_power_i2c_send(u32);
  unsigned int omap4_revision(void);
 +noinline int omap4_scale_vcores(void);
  
  #endif
 diff --git a/arch/arm/mach-omap/omap4_generic.c 
 b/arch/arm/mach-omap/omap4_generic.c
 index c6e46e6..8352470 100644
 --- a/arch/arm/mach-omap/omap4_generic.c
 +++ b/arch/arm/mach-omap/omap4_generic.c
 @@ -419,3 +419,34 @@ enum omap_boot_src omap4_bootsrc(void)
   return OMAP_BOOTSRC_NAND;
   return OMAP_BOOTSRC_UNKNOWN;
  }
 +
 +#define I2C_SLAVE 0x12
 +
 +noinline int omap4_scale_vcores(void)
 +{
 + unsigned int rev = omap4_revision();
 +
 + /* For VC bypass only VCOREx_CGF_FORCE  is necessary and
 +  * VCOREx_CFG_VOLTAGE  changes can be discarded
 +  */
 + writel(0, OMAP44XX_PRM_VC_CFG_I2C_MODE);
 + writel(0x6026, OMAP44XX_PRM_VC_CFG_I2C_CLK);

[PATCH] omap: add support for phycard-a-xl2

2012-03-07 Thread Jan Weitzel
Support for omap4 based Phytec phyCARD-A-XL2 board

Signed-off-by: Jan Weitzel j.weit...@phytec.de
---
 arch/arm/Makefile  |1 +
 arch/arm/boards/phycard-a-xl2/Makefile |   20 ++
 arch/arm/boards/phycard-a-xl2/config.h |1 +
 .../boards/phycard-a-xl2/env/bin/nand_bootstrap|   31 +++
 arch/arm/boards/phycard-a-xl2/env/config   |   52 
 arch/arm/boards/phycard-a-xl2/lowlevel.c   |   95 
 arch/arm/boards/phycard-a-xl2/mux.c|  245 
 arch/arm/boards/phycard-a-xl2/pca-a-xl2.c  |  147 
 arch/arm/configs/phycard_a_xl2_defconfig   |   56 +
 arch/arm/configs/phycard_a_xl2_xload_defconfig |   40 
 arch/arm/mach-omap/Kconfig |   10 +
 11 files changed, 698 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boards/phycard-a-xl2/Makefile
 create mode 100644 arch/arm/boards/phycard-a-xl2/config.h
 create mode 100644 arch/arm/boards/phycard-a-xl2/env/bin/nand_bootstrap
 create mode 100644 arch/arm/boards/phycard-a-xl2/env/config
 create mode 100644 arch/arm/boards/phycard-a-xl2/lowlevel.c
 create mode 100644 arch/arm/boards/phycard-a-xl2/mux.c
 create mode 100644 arch/arm/boards/phycard-a-xl2/pca-a-xl2.c
 create mode 100644 arch/arm/configs/phycard_a_xl2_defconfig
 create mode 100644 arch/arm/configs/phycard_a_xl2_xload_defconfig

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 4c6a566..bf46ca3 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -102,6 +102,7 @@ board-$(CONFIG_MACH_PANDA)  := panda
 board-$(CONFIG_MACH_PCM049):= pcm049
 board-$(CONFIG_MACH_PCA100):= phycard-i.MX27
 board-$(CONFIG_MACH_PCAAL1):= phycard-a-l1
+board-$(CONFIG_MACH_PCAAXL2)   := phycard-a-xl2
 board-$(CONFIG_MACH_PCM037):= pcm037
 board-$(CONFIG_MACH_PCM038):= pcm038
 board-$(CONFIG_MACH_PCM043):= pcm043
diff --git a/arch/arm/boards/phycard-a-xl2/Makefile 
b/arch/arm/boards/phycard-a-xl2/Makefile
new file mode 100644
index 000..1d23d72
--- /dev/null
+++ b/arch/arm/boards/phycard-a-xl2/Makefile
@@ -0,0 +1,20 @@
+# (C) Copyright 2012 Jan Weitzel j.weit...@phytec.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
+obj-y += pca-a-xl2.o mux.o lowlevel.o
diff --git a/arch/arm/boards/phycard-a-xl2/config.h 
b/arch/arm/boards/phycard-a-xl2/config.h
new file mode 100644
index 000..da84fa5
--- /dev/null
+++ b/arch/arm/boards/phycard-a-xl2/config.h
@@ -0,0 +1 @@
+/* nothing */
diff --git a/arch/arm/boards/phycard-a-xl2/env/bin/nand_bootstrap 
b/arch/arm/boards/phycard-a-xl2/env/bin/nand_bootstrap
new file mode 100644
index 000..acd00dc
--- /dev/null
+++ b/arch/arm/boards/phycard-a-xl2/env/bin/nand_bootstrap
@@ -0,0 +1,31 @@
+
+echo copying barebox to nand...
+
+mci0.probe=1
+mkdir mnt
+
+mount /dev/disk0.0 fat /mnt
+if [ $? != 0 ]; then
+   echo failed to mount mmc card
+   exit 1
+fi
+
+if [ ! -f /mnt/mlo-nand.bin ]; then
+   echo mlo-nand.bin not found on mmc card
+   exit 1
+fi
+
+if [ ! -f /mnt/barebox.bin ]; then
+   echo barebox.bin not found on mmc card
+fi
+
+gpmc_nand0.eccmode=bch8_hw_romcode
+erase /dev/nand0.xload.bb
+cp /mnt/mlo-nand.bin /dev/nand0.xload.bb
+
+gpmc_nand0.eccmode=bch8_hw
+erase /dev/nand0.barebox.bb
+cp /mnt/barebox.bin /dev/nand0.barebox.bb
+
+echo success
+
diff --git a/arch/arm/boards/phycard-a-xl2/env/config 
b/arch/arm/boards/phycard-a-xl2/env/config
new file mode 100644
index 000..8ed0459
--- /dev/null
+++ b/arch/arm/boards/phycard-a-xl2/env/config
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+machine=pcaaxl2
+user=
+
+# use 'dhcp' to do dhcp in barebox and in kernel
+# use 'none' if you want to skip kernel ip autoconfiguration
+ip=dhcp
+
+# or set your networking parameters here
+#eth0.ipaddr=a.b.c.d
+#eth0.netmask=a.b.c.d
+#eth0.gateway=a.b.c.d
+#eth0.serverip=a.b.c.d
+
+# can be either 'nfs', 'tftp', 'nor' or 'nand'
+kernel_loc=tftp
+# can be either 'net', 'nor', 'nand' or 'initrd'
+rootfs_loc=net
+
+# can be either 'jffs2' or 'ubifs'
+rootfs_type=ubifs
+rootfsimage=root-${machine}.$rootfs_type
+
+#