Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-18 Thread Igor Grinberg
On 08/18/11 00:58, Eric Jarrige wrote:
 Hi Higor, Hi Stefano,

 On 17 août 2011, at 09:31, Igor Grinberg wrote:

 On 08/12/11 09:49, Stefano Babic wrote:
 On 08/12/2011 01:41 AM, Eric Jarrige wrote:

 Hi Eric,

 +int board_init(void) +{ +   gd-bd-bi_arch_number =
 CONFIG_MACH_TYPE;
 Is there no MACH_TYPE for this board ? It is uncommon for an ARM
 board. Should this board run Linux ?
 The MACH_TYPE for this board is 906. This board runs linux and the
 integration in linux is on going.
 Ok, I have understood. The only thing you can directly set
 MACH_TYPE_APF9328 here. IMHO it is more readable.
 You should not do this here unless you support multiple mach types in a 
 single file.
 Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).
 Here is the README sentence regarding CONFIG_MACH_TYPE:

 CONFIG_MACH_TYPE[relevant for ARM only][mandatory]

 This setting is mandatory for all boards that have only one
 machine type and must be used to specify the machine type
 number as it appears in the ARM machine registry
 (see http://www.arm.linux.org.uk/developer/machines/).
 Only boards that have multiple machine types supported
 in a single configuration file and the machine type is
 runtime discoverable, do not have to use this setting.
 My understanding is:
 1) CONFIG_MACH_TYPE has to be defined in apf9328.h
 2) as gd-bd-bi_arch_number is already initialize in board.c i should 
 completely remove this second initialization from the apf9382.c

Right. Just remove that line.



-- 
Regards,
Igor.

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


Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-18 Thread Stefano Babic
On 08/17/2011 11:58 PM, Eric Jarrige wrote:
 Hi Higor, Hi Stefano,
 

Hi Eric,

 My understanding is:
 1) CONFIG_MACH_TYPE has to be defined in apf9328.h
 2) as gd-bd-bi_arch_number is already initialize in board.c i should 
 completely remove this second initialization from the apf9382.c

You are right - drop only the line in apf9382.c

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: off...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-17 Thread Igor Grinberg

On 08/12/11 09:49, Stefano Babic wrote:
 On 08/12/2011 01:41 AM, Eric Jarrige wrote:

 Hi Eric,

 +int board_init(void) +{ + gd-bd-bi_arch_number =
 CONFIG_MACH_TYPE;
 Is there no MACH_TYPE for this board ? It is uncommon for an ARM
 board. Should this board run Linux ?
 The MACH_TYPE for this board is 906. This board runs linux and the
 integration in linux is on going.
 Ok, I have understood. The only thing you can directly set
 MACH_TYPE_APF9328 here. IMHO it is more readable.

You should not do this here unless you support multiple mach types in a single 
file.
Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).



-- 
Regards,
Igor.

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


Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-17 Thread Eric Jarrige
Hi Higor, Hi Stefano,

On 17 août 2011, at 09:31, Igor Grinberg wrote:

 
 On 08/12/11 09:49, Stefano Babic wrote:
 On 08/12/2011 01:41 AM, Eric Jarrige wrote:
 
 Hi Eric,
 
 +int board_init(void) +{ +gd-bd-bi_arch_number =
 CONFIG_MACH_TYPE;
 Is there no MACH_TYPE for this board ? It is uncommon for an ARM
 board. Should this board run Linux ?
 The MACH_TYPE for this board is 906. This board runs linux and the
 integration in linux is on going.
 Ok, I have understood. The only thing you can directly set
 MACH_TYPE_APF9328 here. IMHO it is more readable.
 
 You should not do this here unless you support multiple mach types in a 
 single file.
 Please, see the CONFIG_MACH_TYPE in the U-Boot documentation (README file).

Here is the README sentence regarding CONFIG_MACH_TYPE:

 CONFIG_MACH_TYPE[relevant for ARM only][mandatory]

 This setting is mandatory for all boards that have only one
 machine type and must be used to specify the machine type
 number as it appears in the ARM machine registry
 (see http://www.arm.linux.org.uk/developer/machines/).
 Only boards that have multiple machine types supported
 in a single configuration file and the machine type is
 runtime discoverable, do not have to use this setting.

My understanding is:
1) CONFIG_MACH_TYPE has to be defined in apf9328.h
2) as gd-bd-bi_arch_number is already initialize in board.c i should 
completely remove this second initialization from the apf9382.c

arch/arm/lib/board.c:
 262 void board_init_f(ulong bootflag)
 ..
 277 
 278 #ifdef CONFIG_MACH_TYPE
 279 gd-bd-bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
 280 #endif 

Please let me know if missed something.

Thx and best regards,
Eric

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


Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-12 Thread Stefano Babic
On 08/12/2011 01:41 AM, Eric Jarrige wrote:

Hi Eric,

 +int board_init(void) +{ +  gd-bd-bi_arch_number =
 CONFIG_MACH_TYPE;
 
 Is there no MACH_TYPE for this board ? It is uncommon for an ARM
 board. Should this board run Linux ?
 The MACH_TYPE for this board is 906. This board runs linux and the
 integration in linux is on going.

Ok, I have understood. The only thing you can directly set
MACH_TYPE_APF9328 here. IMHO it is more readable.

 +#if (CONFIG_DRIVER_DM9000) +   imx_gpio_mode(GPIO_PORTB | GPIO_DR
 | GPIO_IN | 14);
 
 Is there a reason to put this code here and not in board_eth_init ?
 It is related to Ethernet and I am supposing this setup should be
 done before dm9000_initialize.
 The idea is to keep the configuration  of the CPU pins at one place
 and to keep the initialization of the ethernet controller in a
 separate function. Here this principle of segregation is not obvious
 as there is only one GPIO pin to configure.

Ok, understood. Maybe it is better to move this kind of initialization
adding a board_early_init_f() function (you need
CONFIG_BOARD_EARLY_INIT_F in your config). This assures that the gpio is
always set before the ethernet is initialized, as I suppose it must be.
Letting in the misc_init() works now, but the order could be changed in
future - the erarly entry point is thought for hardware initialization
before starting the drivers.

 This function seems to me not very useful. Is it not better to drop
 it ? It is not strictly required. You set also #undef
 CONFIG_SHOW_BOOT_PROGRESS in the configuration file.
 Well I choosed to keep it in place in empty state to be the template
 for the final user to add their own debug method if needed. If it is
 an issue I would prefer to define the CONFIG_SHOW_BOOT_PROGRESS in
 the configuration file than removing this empty show_boot_progress as
 the main purpose of the board is education and trainings on embedded
 developments.

However, if the function is empty, the functionality is not shown - it
is quite dead code and does not teach very much. What about to add some
very simple code, as a print() or switching a led, for example, to
indicate which is the goal of the function ?

 Do you have more as one FPGA on your board ? And if this is true,
 they share the same firmware ? (I see only one
 CONFIG_FIRMWARE_ADDR..)
 The APF9328 is a SOM therefore it possible to connect some other FPGA
 to the board. In such a situation the idea is to concatenate all the
 bitstream files in the firmware partition. During the download
 process to the FPGAs the end of one FPGA download starts the download
 of the next one using the FPGA signal PRG_DONE. So that it possible
 to have all firmware in only one partition and save memory space by
 using bitstream files. To be honest I do not remember if someone use
 this feature on this board but that is .

You are the best to say if it is work. Reading the code, I have expected
to see one fpga_load for each defined fpga structure, using offset
inside the loop to pass the correct start and length for each image.

Can you add a comment to explain the behavior and the fact the FPGAs are
concatenated ?


 For the time being this switch applies to this board only. So I did
 not plan to document it in the README. It is not clear for me if I
 should add a documentation in the README since this switch is only
 used in the APF9328 source files.

Then drop all this stuff from the configuration file and rename in a way
it is clear it is specific for your board only. You do not need to
document them in the README, because they are not general CONFIG_ switches.

 Well, What do you think to add the prototype directly in apf9328.c:
 extern int apf9328_init_fpga(void); This will avoid to expose the
 fpga_xx_fn to apf9328.c that does not care how the firmware is moved
 from CPU to FPGA and therefore remove the very small apf9328_fpga.h

Agree.

 However, this code is quite the same I can find on other IMX
 boards. Can we factorize it and push it as common code ?
 
 The other boards use hardcoded values that are not compatible with
 the apf9328 board. We do not use the same components and so cannot
 reuse or merge their code. A factorization would require deep changes
 in the config files of every board. For this old CPU there is no
 chance to convince the maintainers of the other boards to rework
 their implementation and specifically the boot code in assembly.

This is right. These processors are obsolete, there are no more active
development for them. It is enough to see how many patches for theses
processors were sent to the list in the last years (only 1, to fix the
mx1ads board).

 
 On the other hand I am working on some other ARM SOC more recent, so
 It may worth the pain to invest some effrot of  factorization on
 modern CPUs. What is your opinion?

Of course, this is a must and duplication of code must be avoided.
However, is there a chance to move your assembly file into
arch/arm/cpu/arm920t/imx/, making it 

Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-11 Thread Stefano Babic
On 08/10/2011 10:33 PM, Eric Jarrige wrote:
 Add Armadeus Project board APF9328
 
 Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org
 Signed-off-by: Nicolas Colombain nicolas.colomb...@armadeus.com

Hi Eric,


 diff --git a/board/armadeus/apf9328/apf9328.c 
 b/board/armadeus/apf9328/apf9328.c
 new file mode 100644
 index 000..2250221
 --- /dev/null
 +++ b/board/armadeus/apf9328/apf9328.c
 @@ -0,0 +1,91 @@
 +/*
 + * (C) Copyright 2005-2011
 + * Nicolas Colombin tho...@users.sourceforge.net
 + * Eric Jarrige eric.jarr...@armadeus.org
 + * Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + *
 + */
 +
 +#include common.h
 +#include asm/arch/imx-regs.h
 +#include flash.h
 +#include netdev.h
 +#include apf9328fpga.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +int board_init(void)
 +{
 + gd-bd-bi_arch_number = CONFIG_MACH_TYPE;

Is there no MACH_TYPE for this board ? It is uncommon for an ARM board.
Should this board run Linux ?

 +void dram_init_banksize(void)
 +{
 +#if (CONFIG_NR_DRAM_BANKS  0)

I think you can get rid of this #ifdef, if you have no RAM at all you
cannot simply run u-boot.

 + * Miscellaneous intialization
 + */
 +int misc_init_r(void)
 +{
 + char *s;
 +
 +#if (CONFIG_FPGA)
 + apf9328_init_fpga();
 +#endif
 +
 +#if (CONFIG_DRIVER_DM9000)
 + imx_gpio_mode(GPIO_PORTB | GPIO_DR | GPIO_IN | 14);

Is there a reason to put this code here and not in board_eth_init ? It
is related to Ethernet and I am supposing this setup should be done
before dm9000_initialize.

 +
 +void show_boot_progress(int status)
 +{
 + return;
 +}

This function seems to me not very useful. Is it not better to drop it ?
It is not strictly required.
You set also #undef CONFIG_SHOW_BOOT_PROGRESS in the configuration file.


 +#if (CONFIG_FPGA)
 +DECLARE_GLOBAL_DATA_PTR;
 +/* Note that these are pointers to code that is in Flash.  They will be
 + * relocated at runtime.
 + * Spartan3 code is used to download our Spartan 3 :) code is compatible.
 + * Just take care about the file size
 +*/
 +Xilinx_Spartan3_Slave_Serial_fns fpga_fns = {
 + fpga_pre_fn,
 + fpga_pgm_fn,
 + fpga_clk_fn,
 + fpga_init_fn,
 + fpga_done_fn,
 + fpga_wr_fn,
 +};
 +
 +Xilinx_desc fpga[CONFIG_FPGA_COUNT] = {

Do you have more as one FPGA on your board ? And if this is true, they
share the same firmware ? (I see only one CONFIG_FIRMWARE_ADDR..)

 +/*
 + * Initialize the fpga.  Return 1 on success, 0 on failure.
 + */
 +int apf9328_init_fpga(void)
 +{
 + char *autoload = getenv(firmware_autoload);
 + int i, lout = 1;
 +
 + debug(%s:%d: Initialize FPGA interface (relocation offset= 0x%.8lx)\n,
 + __func__, __LINE__, gd-reloc_off);
 +
 + fpga_init();
 +
 + for (i = 0; i  CONFIG_FPGA_COUNT; i++) {
 + debug(%s:%d: Adding fpga %d\n, __func__, __LINE__, i);
 + fpga_add(fpga_xilinx, fpga[i]);
 + }
 +
 + if ((autoload)  (0 == strcmp(autoload, 1))) {
 + if (FPGA_SUCCESS != fpga_load(0, (void *)CONFIG_FIRMWARE_ADDR,

I am confused...you add in the configuration file a variable
firmware_addr=, and you set it as default to CONFIG_FIRMWARE_ADDR, but
you do not use this variable at all. Do you not shoul get the address
with getenv(firmware_addr) instead of the precompiled value ?

If you add some new CONFIG_ switches in U-Boot, you must document them
in the Readme file. However, CONFIG_FIRMWARE_* do not need to be global,
right ?

 +/*
 + * Spartan 3 FPGA configuration support for the APF9328 daughter board
 + */
 +
 +#include fpga.h
 +extern int apf9328_init_fpga(void);
 diff --git a/board/armadeus/apf9328/eeprom.c b/board/armadeus/apf9328/eeprom.c

It seems to much fo me to add a new file only for a single prototype.
and it is used only in apf9328fpga.c, as I can see.

 +
 +#include common.h
 +#include command.h
 +#include dm9000.h
 +
 +static int do_read_dm9000_eeprom(cmd_tbl_t *cmdtp, int flag, int argc,
 +  char * const argv[])
 +{
 + unsigned int i;
 + u8 data[2];
 +
 + for (i = 0; i  0x40; i++) {
 + if (!(i % 0x10))
 + printf(\n%08x:, i);
 + dm9000_read_srom_word(i, data);
 + printf( %02x%02x, data[1], data[0]);
 + }

Re: [U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-11 Thread Eric Jarrige
Hi Stefano,

 On 08/10/2011 10:33 PM, Eric Jarrige wrote:
 Add Armadeus Project board APF9328
 
 Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org
 Signed-off-by: Nicolas Colombain nicolas.colomb...@armadeus.com
 
 Hi Eric,
 
 
 diff --git a/board/armadeus/apf9328/apf9328.c 
 b/board/armadeus/apf9328/apf9328.c
 new file mode 100644
 index 000..2250221
 --- /dev/null
 +++ b/board/armadeus/apf9328/apf9328.c
 @@ -0,0 +1,91 @@
 +/*
 + * (C) Copyright 2005-2011
 + * Nicolas Colombin tho...@users.sourceforge.net
 + * Eric Jarrige eric.jarr...@armadeus.org
 + * Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + *
 + */
 +
 +#include common.h
 +#include asm/arch/imx-regs.h
 +#include flash.h
 +#include netdev.h
 +#include apf9328fpga.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +int board_init(void)
 +{
 +gd-bd-bi_arch_number = CONFIG_MACH_TYPE;
 
 Is there no MACH_TYPE for this board ? It is uncommon for an ARM board.
 Should this board run Linux ?
The MACH_TYPE for this board is 906. This board runs linux and the integration 
in linux is on going.
 
 +void dram_init_banksize(void)
 +{
 +#if (CONFIG_NR_DRAM_BANKS  0)
 
 I think you can get rid of this #ifdef, if you have no RAM at all you
 cannot simply run u-boot.
Good point. I will fix it.

 
 + * Miscellaneous intialization
 + */
 +int misc_init_r(void)
 +{
 +char *s;
 +
 +#if (CONFIG_FPGA)
 +apf9328_init_fpga();
 +#endif
 +
 +#if (CONFIG_DRIVER_DM9000)
 +imx_gpio_mode(GPIO_PORTB | GPIO_DR | GPIO_IN | 14);
 
 Is there a reason to put this code here and not in board_eth_init ? It
 is related to Ethernet and I am supposing this setup should be done
 before dm9000_initialize.
The idea is to keep the configuration  of the CPU pins at one place and to keep 
the initialization of the ethernet controller in a separate function. 
Here this principle of segregation is not obvious as there is only one GPIO pin 
to configure.

 
 
 +
 +void show_boot_progress(int status)
 +{
 +return;
 +}
 
 This function seems to me not very useful. Is it not better to drop it ?
 It is not strictly required.
 You set also #undef CONFIG_SHOW_BOOT_PROGRESS in the configuration file.
Well I choosed to keep it in place in empty state to be the template for the 
final user to add their own debug method if needed.
If it is an issue I would prefer to define the CONFIG_SHOW_BOOT_PROGRESS in the 
configuration file than removing this empty show_boot_progress as the main 
purpose of the board is education and trainings on embedded developments.

 
 
 +#if (CONFIG_FPGA)
 +DECLARE_GLOBAL_DATA_PTR;
 +/* Note that these are pointers to code that is in Flash.  They will be
 + * relocated at runtime.
 + * Spartan3 code is used to download our Spartan 3 :) code is compatible.
 + * Just take care about the file size
 +*/
 +Xilinx_Spartan3_Slave_Serial_fns fpga_fns = {
 +fpga_pre_fn,
 +fpga_pgm_fn,
 +fpga_clk_fn,
 +fpga_init_fn,
 +fpga_done_fn,
 +fpga_wr_fn,
 +};
 +
 +Xilinx_desc fpga[CONFIG_FPGA_COUNT] = {
 
 Do you have more as one FPGA on your board ? And if this is true, they
 share the same firmware ? (I see only one CONFIG_FIRMWARE_ADDR..)
The APF9328 is a SOM therefore it possible to connect some other FPGA to the 
board. In such a situation the idea is to concatenate all the bitstream files 
in the firmware partition.
During the download process to the FPGAs the end of one FPGA download starts 
the download of the next one using the FPGA signal PRG_DONE.
So that it possible to have all firmware in only one partition and save memory 
space by using bitstream files.
To be honest I do not remember if someone use this feature on this board but 
that is . 

 
 +/*
 + * Initialize the fpga.  Return 1 on success, 0 on failure.
 + */
 +int apf9328_init_fpga(void)
 +{
 +char *autoload = getenv(firmware_autoload);
 +int i, lout = 1;
 +
 +debug(%s:%d: Initialize FPGA interface (relocation offset= 0x%.8lx)\n,
 +__func__, __LINE__, gd-reloc_off);
 +
 +fpga_init();
 +
 +for (i = 0; i  CONFIG_FPGA_COUNT; i++) {
 +debug(%s:%d: Adding fpga %d\n, __func__, __LINE__, i);
 +fpga_add(fpga_xilinx, fpga[i]);
 +}
 +
 +if ((autoload)  (0 == strcmp(autoload, 1))) {
 +if 

[U-Boot] [PATCH 3/9] apf9328: Add Armadeus Project board APF9328

2011-08-10 Thread Eric Jarrige
Add Armadeus Project board APF9328

Signed-off-by: Eric Jarrige eric.jarr...@armadeus.org
Signed-off-by: Nicolas Colombain nicolas.colomb...@armadeus.com
---
 board/armadeus/apf9328/Makefile|   51 +++
 board/armadeus/apf9328/apf9328.c   |   91 ++
 board/armadeus/apf9328/apf9328fpga.c   |   89 ++
 board/armadeus/apf9328/apf9328fpga.h   |   31 ++
 board/armadeus/apf9328/eeprom.c|   88 ++
 board/armadeus/apf9328/fpga.c  |  121 
 board/armadeus/apf9328/fpga.h  |   30 ++
 board/armadeus/apf9328/i2c.c   |  276 +++
 board/armadeus/apf9328/lowlevel_init.S |  469 
 9 files changed, 1246 insertions(+), 0 deletions(-)
 create mode 100644 board/armadeus/apf9328/Makefile
 create mode 100644 board/armadeus/apf9328/apf9328.c
 create mode 100644 board/armadeus/apf9328/apf9328fpga.c
 create mode 100644 board/armadeus/apf9328/apf9328fpga.h
 create mode 100644 board/armadeus/apf9328/eeprom.c
 create mode 100644 board/armadeus/apf9328/fpga.c
 create mode 100644 board/armadeus/apf9328/fpga.h
 create mode 100644 board/armadeus/apf9328/i2c.c
 create mode 100644 board/armadeus/apf9328/lowlevel_init.S

diff --git a/board/armadeus/apf9328/Makefile b/board/armadeus/apf9328/Makefile
new file mode 100644
index 000..0f097cd
--- /dev/null
+++ b/board/armadeus/apf9328/Makefile
@@ -0,0 +1,51 @@
+#
+# (C) Copyright 2000-2004
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := apf9328.o i2c.o apf9328fpga.o fpga.o eeprom.o
+SOBJS  := lowlevel_init.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/armadeus/apf9328/apf9328.c b/board/armadeus/apf9328/apf9328.c
new file mode 100644
index 000..2250221
--- /dev/null
+++ b/board/armadeus/apf9328/apf9328.c
@@ -0,0 +1,91 @@
+/*
+ * (C) Copyright 2005-2011
+ * Nicolas Colombin tho...@users.sourceforge.net
+ * Eric Jarrige eric.jarr...@armadeus.org
+ * Copyright (C) 2004 Sascha Hauer, Synertronixx GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include common.h
+#include asm/arch/imx-regs.h
+#include flash.h
+#include netdev.h
+#include apf9328fpga.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+   gd-bd-bi_arch_number = CONFIG_MACH_TYPE;
+   gd-bd-bi_boot_params = CONFIG_BOOT_PARAMS_ADDR;
+
+   return 0;
+}
+
+int dram_init(void)
+{
+   /* dram_init must store complete ramsize in gd-ram_size */
+   gd-ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_1_BASE,
+   CONFIG_SYS_SDRAM_1_SIZE);
+   return 0;
+}
+
+void dram_init_banksize(void)
+{
+#if (CONFIG_NR_DRAM_BANKS  0)
+   gd-bd-bi_dram[0].start = CONFIG_SYS_SDRAM_1_BASE;
+   gd-bd-bi_dram[0].size = CONFIG_SYS_SDRAM_1_SIZE;
+#endif
+}
+
+/*
+ * Miscellaneous intialization
+ */
+int misc_init_r(void)
+{
+   char *s;
+
+#if (CONFIG_FPGA)
+   apf9328_init_fpga();
+#endif