All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:24 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:24 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:24:42 +0000 (Tue, 06 Jan 2009)
New Revision: 24706

Log:
Add CONFIGs for new commands to at91 parts

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-013-configs.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-013-configs.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-013-configs.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-013-configs.patch	2009-01-06 16:24:42 UTC (rev 24706)
@@ -0,0 +1,130 @@
+diff -urN u-boot-2009.01-0rig//include/configs/at91cap9adk.h u-boot-2009.01/include/configs/at91cap9adk.h
+--- u-boot-2009.01-0rig//include/configs/at91cap9adk.h	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/include/configs/at91cap9adk.h	2009-01-04 00:43:58.000000000 +0100
+@@ -69,7 +69,9 @@
+ #define CONFIG_ATMEL_LCD		1
+ #define CONFIG_ATMEL_LCD_BGR555		1
+ #define CONFIG_SYS_CONSOLE_IS_IN_ENV		1
+-
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ #define CONFIG_BOOTDELAY	3
+ 
+ /*
+diff -urN u-boot-2009.01-0rig//include/configs/at91rm9200df.h u-boot-2009.01/include/configs/at91rm9200df.h
+--- u-boot-2009.01-0rig//include/configs/at91rm9200df.h	2009-01-02 17:37:43.000000000 +0100
++++ u-boot-2009.01/include/configs/at91rm9200df.h	2009-01-04 00:43:33.000000000 +0100
+@@ -123,6 +123,9 @@
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_MII
+ #define CONFIG_CMD_NAND
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ #define CONFIG_CMD_AT91_SPIMUX
+ #define CONFIG_CMD_ETHINIT
+ 
+diff -urN u-boot-2009.01-0rig//include/configs/at91rm9200dk_df.h u-boot-2009.01/include/configs/at91rm9200dk_df.h
+--- u-boot-2009.01-0rig//include/configs/at91rm9200dk_df.h	2009-01-02 10:03:11.000000000 +0100
++++ u-boot-2009.01/include/configs/at91rm9200dk_df.h	2009-01-04 00:42:52.000000000 +0100
+@@ -122,7 +122,11 @@
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_MII
+ #define CONFIG_CMD_NAND
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ #define CONFIG_CMD_AT91_SPIMUX
++#define CONFIG_CMD_ETHINIT
+ 
+ #define CONFIG_NAND_LEGACY
+ 
+diff -urN u-boot-2009.01-0rig//include/configs/at91rm9200dk.h u-boot-2009.01/include/configs/at91rm9200dk.h
+--- u-boot-2009.01-0rig//include/configs/at91rm9200dk.h	2009-01-02 10:03:11.000000000 +0100
++++ u-boot-2009.01/include/configs/at91rm9200dk.h	2009-01-04 00:43:15.000000000 +0100
+@@ -120,7 +120,11 @@
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_MII
+ #define CONFIG_CMD_NAND
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ #define CONFIG_CMD_AT91_SPIMUX
++#define CONFIG_CMD_ETHINIT
+ 
+ #define CONFIG_NAND_LEGACY
+ 
+diff -urN u-boot-2009.01-0rig//include/configs/at91rm9200ek.h u-boot-2009.01/include/configs/at91rm9200ek.h
+--- u-boot-2009.01-0rig//include/configs/at91rm9200ek.h	2009-01-02 17:37:43.000000000 +0100
++++ u-boot-2009.01/include/configs/at91rm9200ek.h	2009-01-04 00:42:35.000000000 +0100
+@@ -121,9 +121,11 @@
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_MII
+ #define CONFIG_CMD_NAND
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ #define CONFIG_CMD_AT91_SPIMUX
+ #define CONFIG_CMD_ETHINIT
+-
+ #define CONFIG_NAND_LEGACY
+ 
+ #define CONFIG_SYS_MAX_NAND_DEVICE	1	/* Max number of NAND devices		*/
+diff -urN u-boot-2009.01-0rig//include/configs/at91sam9260ek.h u-boot-2009.01/include/configs/at91sam9260ek.h
+--- u-boot-2009.01-0rig//include/configs/at91sam9260ek.h	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/include/configs/at91sam9260ek.h	2009-01-04 00:41:56.000000000 +0100
+@@ -74,10 +74,13 @@
+ #include <config_cmd_default.h>
+ #undef CONFIG_CMD_BDI
+ #undef CONFIG_CMD_IMI
+-#undef CONFIG_CMD_AUTOSCRIPT
++#define CONFIG_CMD_AUTOSCRIPT
+ #undef CONFIG_CMD_FPGA
+ #undef CONFIG_CMD_LOADS
+ #undef CONFIG_CMD_IMLS
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ 
+ #define CONFIG_CMD_PING		1
+ #define CONFIG_CMD_DHCP		1
+diff -urN u-boot-2009.01-0rig//include/configs/at91sam9261ek.h u-boot-2009.01/include/configs/at91sam9261ek.h
+--- u-boot-2009.01-0rig//include/configs/at91sam9261ek.h	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/include/configs/at91sam9261ek.h	2009-01-04 00:44:11.000000000 +0100
+@@ -68,6 +68,9 @@
+ #define CONFIG_ATMEL_LCD		1
+ #define CONFIG_ATMEL_LCD_BGR555		1
+ #define CONFIG_SYS_CONSOLE_IS_IN_ENV		1
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ 
+ #define CONFIG_BOOTDELAY	3
+ 
+diff -urN u-boot-2009.01-0rig//include/configs/at91sam9263ek.h u-boot-2009.01/include/configs/at91sam9263ek.h
+--- u-boot-2009.01-0rig//include/configs/at91sam9263ek.h	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/include/configs/at91sam9263ek.h	2009-01-04 00:44:34.000000000 +0100
+@@ -69,6 +69,9 @@
+ #define CONFIG_ATMEL_LCD		1
+ #define CONFIG_ATMEL_LCD_BGR555		1
+ #define CONFIG_SYS_CONSOLE_IS_IN_ENV		1
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ 
+ #define CONFIG_BOOTDELAY	3
+ 
+diff -urN u-boot-2009.01-0rig//include/configs/at91sam9rlek.h u-boot-2009.01/include/configs/at91sam9rlek.h
+--- u-boot-2009.01-0rig//include/configs/at91sam9rlek.h	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/include/configs/at91sam9rlek.h	2009-01-04 00:44:54.000000000 +0100
+@@ -68,6 +68,9 @@
+ #define CONFIG_ATMEL_LCD		1
+ #define CONFIG_ATMEL_LCD_RGB565		1
+ #define CONFIG_SYS_CONSOLE_IS_IN_ENV		1
++#define CONFIG_CMD_FACTORY
++#define CONFIG_CMD_LED
++#define CONFIG_COLOURED_LED
+ 
+ #define CONFIG_BOOTDELAY	3
+ 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 17:22           ` Ulf Samuelsson
@ 2009-01-06 18:13             ` Peter Korsgaard
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 18:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:

 Ulf> If you want to avoid cluttering the u-boot directory
 Ulf> with patches, then it is of course a possibility
 Ulf> to apply all patches and store the tarball on $(ATMEL_MIRROR)
 Ulf> That will make the patches harder to maintain and 
 Ulf> it will take longer to get them into mainline.

Why? Having them in buildroot or not seems pretty unrelated to their
upstream acceptance or not.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 16:18         ` Peter Korsgaard
@ 2009-01-06 17:22           ` Ulf Samuelsson
  2009-01-06 18:13             ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: Ulf Samuelsson @ 2009-01-06 17:22 UTC (permalink / raw)
  To: buildroot

tis 2009-01-06 klockan 17:18 +0100 skrev Peter Korsgaard:
> >>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:
> 
> Hi,
> 
>  Ulf> ?There will be some other fixes due to the CFG->CONFIG(_SYS)
>  >> 
>  >> Yes, that's what I mentioned last week. This again will complicate
>  >> stuff when we're supporting 3+ U-Boot versions.
>  >> 
> 
>  Ulf> I only submit the patches to the 2009.01-rc1 directory,
> 
> Yes, but the stuff you do with setting U-Boot configuration variables
> from within Buildroot needs to handle both CFG_ and CONFIG_SYS_
> variants, E.G. stuff like:
> 
> CFG_DDR_SIZE got turned into CONFIG_SYS_DDR_SIZE, same for
> CFG_FLASH_SIZE or whatever defines you are using.

OK.

> 
>  Ulf> Contary on my opinion on linux, I do not mind if we
>  Ulf> obsolete older u-boot versions, like 1.3.4.
>  Ulf> Also, I am not hurt if we keep it.
> 
> I would like to deprecate 1.3.4 atleast - And I guess the AT91 1.2.0
> thing as well?
> 

Once I am 100% confident with the u-boot.2009.01-rc1
and its follow on, then it is time to get rid of 1.2.0-atmel.

For 1.3.4 you have to discuss that with other people
using the stuff.

> 
>  >> They just have to try again like the rest of us, or maybe ping
>  >> wdenx on irc.
> 
>  Ulf> That is what they are doing now, but the SAM9G20 support is
>  Ulf> too new to have been submitted to trunk.
>  Ulf> It is done for 1.3.4 but can not be submitted to
>  Ulf> 2009.01-rc1 dues to the changes CFG->CONFIG.
> 
> Why was that work done for the ancient 1.3.4 in the first place?

1.3.4 is not ancient.
It is a mere 2 revisions back and there are about
20-30 boards to test through.
That takes time.

> 
>  Ulf> Currently the merge window is closed, but I expect
>  Ulf> to submit the board support patches and some of the
>  Ulf> new commands end of January.
>  >> 
>  >> Ok, please do so. There's afaik nothing stopping you from submitting
>  >> patches now so they can be integrated by the arm/at91 subtree
>  >> maintainer.
> 
>  Ulf> I did submit a patch outside the merge window some time ago,
>  Ulf> and then I did not feel that was appreciated,
>  Ulf> but that was maybe before the custodian concept was 
>  Ulf> fully established.
> 
> It afaik works like the Linux kernel now, so you should preferably get
> your patches in the custodians git tree BEFORE the merge window opens.

OK, I take your point and start submitting stuff earlier.

> 
>  Ulf> The factory default command relies heavily on
>  Ulf> the buildroot configuration, so it may make less
>  Ulf> sense to include that in the main u-boot trunk.
>  >> 
>  >> What's the point of it? Is it any different than simply erasing the
>  >> environment and resetting the board?
> 
>  Ulf> Yes, once you run the "factory" command, your environment
>  Ulf> is set up so you can download and flash the kernel and rootfs
>  Ulf> with a simple command.
> 
> But why don't you simply setup those environment settings in the
> default config (CONFIG_EXTRA_ENV_SETTINGS) ? That's what other people
> do. Then it's just a matter of clearing your environment and your back
> to scratch.

OK, so how do you find out what to do without a manual.
What happens if someone erases the wrong part of the flash?
Support, support...
What happens if you want to keep some of your settings?
"factor" will change the special variables, but it does not
clean the environment.


>  Ulf> Once you are away from your development environment
>  Ulf> and has changed the environment, you are screwed.
> 
> Why? just erase and reset.

The way to repair an electronic unit which has
a flash bit error, is not to erase the flash
and hand the unit back to the customer.

You program it to a known state.


> 
>  Ulf> It is especially useful for newbies which have zero
>  Ulf> experience with linux/u-boot.
>  Ulf> I have several hundred companies working on AT91 
>  Ulf> stuff in my region, many of them complete newbies.
>  Ulf> I need to support them all, and if things are difficult,
>  Ulf> it will simply fall to pieces.
> 
> Ok, but maybe that would be a feature of the Atmel buildroot fork
> then?

The Atmel buildroot fork is focusing on the AVR32.

>  Ulf> Would you hand a board over to your grandmother
>  Ulf> and then help her over the phone to boot linux?
>  Ulf> It really needs to be so simple that this
>  Ulf> approach has a fair chance of succeeding.
> 
> Then I don't believe buildroot is the correct solution for them.
> 
>  >> I don't like us carrying feature patches in buildroot.
> 
>  Ulf> the "because" and the rest of the statement seems
>  Ulf> to have been filtered away somewhere ;-)
> 
> Because we don't have enough ressources to maintain all the other
> stuff as it is, without carrying (and maintaining/supporting/..) new
> features to upstream projects.
> Upstream development belongs in the upstream projects, not in
> buildroot - Anything else doesn't scale in the long run.
> 

All these features has been available since the U-Boot was
introduced in Buildroot (with the exception of the SAM9G20).

There has been complaints about having two version
with different limitations in both.
People have been asking for sam9g20 support and other things.
That is why I am trying to merge with the later "target/u-boot"
function.

I don't think a merge of target/device/Atmel/u-boot and
target/u-boot is OK; if that means removing functionality.

If you want to avoid cluttering the u-boot directory
with patches, then it is of course a possibility
to apply all patches and store the tarball on $(ATMEL_MIRROR)
That will make the patches harder to maintain and 
it will take longer to get them into mainline.

Another alternative is to introduce a way to select a patchset
like it is possible for the linux kernel.


> -- 
> Bye, Peter Korsgaard
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 16:24 ulf at uclibc.org
@ 2009-01-06 16:33 ` Peter Korsgaard
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 16:33 UTC (permalink / raw)
  To: buildroot

>>>>> "ulf" == ulf  <ulf@uclibc.org> writes:

 ulf> Author: ulf
 ulf> Date: 2009-01-06 16:24:06 +0000 (Tue, 06 Jan 2009)
 ulf> New Revision: 24705

 ulf> Log:
 ulf> Add support for waiting for NFS root server before booting

 ulf> Added:
 ulf>    trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch

Please stop.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 16:17 ulf at uclibc.org
@ 2009-01-06 16:32 ` Peter Korsgaard
  0 siblings, 0 replies; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 16:32 UTC (permalink / raw)
  To: buildroot

>>>>> "ulf" == ulf  <ulf@uclibc.org> writes:

 ulf> Author: ulf
 ulf> Date: 2009-01-06 16:17:15 +0000 (Tue, 06 Jan 2009)
 ulf> New Revision: 24702

 ulf> Log:
 ulf> Add 'led' command to control coloured LEDs

Please don't add any more feature patches while we're discussing their
merrit.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:24 ulf at uclibc.org
  2009-01-06 16:33 ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:24 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:24:06 +0000 (Tue, 06 Jan 2009)
New Revision: 24705

Log:
Add support for waiting for NFS root server before booting

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch	2009-01-06 16:24:06 UTC (rev 24705)
@@ -0,0 +1,77 @@
+diff -urN u-boot-2009.01-0rig//common/cmd_ethinit.c u-boot-2009.01/common/cmd_ethinit.c
+--- u-boot-2009.01-0rig//common/cmd_ethinit.c	1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2009.01/common/cmd_ethinit.c	2009-01-04 00:28:39.000000000 +0100
+@@ -0,0 +1,62 @@
++/*
++ * (C) Copyright 2000
++ * Wolfgang Denk, DENX Software Engineering, wd at 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
++ */
++
++/*
++ * Boot support
++ */
++#include <common.h>
++#include <command.h>
++#include <net.h>
++#ifdef CONFIG_CMD_ETHINIT
++extern int eth_init (bd_t * bd);
++
++static void	delay(void)
++{
++}
++/* 
++ * This command allows you to delay booting until you have a 
++ * valid Ethernet connection.
++ * Neccessary if you want to NFS mount a rootfs etc.
++ * When both this target and the NFS server 
++ * are powered on at the same time, then the NFS
++ * server can take a long time to boot.
++ */
++int do_ethinit (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++	int	i;
++	DECLARE_GLOBAL_DATA_PTR;
++	while(eth_init (gd->bd) == 0) {
++		for(i = 0; i < 10000000; i ++) {
++			delay();
++		}
++	}
++	return 0;
++}
++
++U_BOOT_CMD(
++	ethinit,	1,	1,	do_ethinit,
++	"ethinit\t- Initialize Ethernet controller\n",
++	"\n"
++);
++
++#endif	/* CONFIG_CMD_ETHINIT */
+diff -urN u-boot-2009.01-0rig//common/Makefile u-boot-2009.01/common/Makefile
+--- u-boot-2009.01-0rig//common/Makefile	2009-01-04 00:22:06.000000000 +0100
++++ u-boot-2009.01/common/Makefile	2009-01-04 00:29:46.000000000 +0100
+@@ -83,6 +83,7 @@
+ COBJS-$(CONFIG_ENV_IS_IN_EEPROM) += cmd_eeprom.o
+ COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
+ COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
++COBJS-$(CONFIG_CMD_ETHINIT) += cmd_ethinit.o
+ COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
+ COBJS-$(CONFIG_CMD_FACTORY) += cmd_factory.o
+ COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:21 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:21 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:21:36 +0000 (Tue, 06 Jan 2009)
New Revision: 24704

Log:
Remove patches that should not have been inlcuded in the spimux commit

Removed:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-013-configs.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-014-at572d940hfeb.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-016-cmd_mem.patch


Changeset:

Sorry, the patch is too large to include (4508 lines).
Please use ViewCVS to see it!

http://uclibc.org/cgi-bin/viewcvs.cgi?view=rev&root=svn&rev=24704

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 15:56       ` Ulf Samuelsson
@ 2009-01-06 16:18         ` Peter Korsgaard
  2009-01-06 17:22           ` Ulf Samuelsson
  0 siblings, 1 reply; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 16:18 UTC (permalink / raw)
  To: buildroot

>>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:

Hi,

 Ulf> ?There will be some other fixes due to the CFG->CONFIG(_SYS)
 >> 
 >> Yes, that's what I mentioned last week. This again will complicate
 >> stuff when we're supporting 3+ U-Boot versions.
 >> 

 Ulf> I only submit the patches to the 2009.01-rc1 directory,

Yes, but the stuff you do with setting U-Boot configuration variables
from within Buildroot needs to handle both CFG_ and CONFIG_SYS_
variants, E.G. stuff like:

CFG_DDR_SIZE got turned into CONFIG_SYS_DDR_SIZE, same for
CFG_FLASH_SIZE or whatever defines you are using.

 Ulf> Contary on my opinion on linux, I do not mind if we
 Ulf> obsolete older u-boot versions, like 1.3.4.
 Ulf> Also, I am not hurt if we keep it.

I would like to deprecate 1.3.4 atleast - And I guess the AT91 1.2.0
thing as well?


 >> They just have to try again like the rest of us, or maybe ping
 >> wdenx on irc.

 Ulf> That is what they are doing now, but the SAM9G20 support is
 Ulf> too new to have been submitted to trunk.
 Ulf> It is done for 1.3.4 but can not be submitted to
 Ulf> 2009.01-rc1 dues to the changes CFG->CONFIG.

Why was that work done for the ancient 1.3.4 in the first place?

 Ulf> Currently the merge window is closed, but I expect
 Ulf> to submit the board support patches and some of the
 Ulf> new commands end of January.
 >> 
 >> Ok, please do so. There's afaik nothing stopping you from submitting
 >> patches now so they can be integrated by the arm/at91 subtree
 >> maintainer.

 Ulf> I did submit a patch outside the merge window some time ago,
 Ulf> and then I did not feel that was appreciated,
 Ulf> but that was maybe before the custodian concept was 
 Ulf> fully established.

It afaik works like the Linux kernel now, so you should preferably get
your patches in the custodians git tree BEFORE the merge window opens.

 Ulf> The factory default command relies heavily on
 Ulf> the buildroot configuration, so it may make less
 Ulf> sense to include that in the main u-boot trunk.
 >> 
 >> What's the point of it? Is it any different than simply erasing the
 >> environment and resetting the board?

 Ulf> Yes, once you run the "factory" command, your environment
 Ulf> is set up so you can download and flash the kernel and rootfs
 Ulf> with a simple command.

But why don't you simply setup those environment settings in the
default config (CONFIG_EXTRA_ENV_SETTINGS) ? That's what other people
do. Then it's just a matter of clearing your environment and your back
to scratch.

 Ulf> Once you are away from your development environment
 Ulf> and has changed the environment, you are screwed.

Why? just erase and reset.

 Ulf> It is especially useful for newbies which have zero
 Ulf> experience with linux/u-boot.
 Ulf> I have several hundred companies working on AT91 
 Ulf> stuff in my region, many of them complete newbies.
 Ulf> I need to support them all, and if things are difficult,
 Ulf> it will simply fall to pieces.

Ok, but maybe that would be a feature of the Atmel buildroot fork
then?

 Ulf> Would you hand a board over to your grandmother
 Ulf> and then help her over the phone to boot linux?
 Ulf> It really needs to be so simple that this
 Ulf> approach has a fair chance of succeeding.

Then I don't believe buildroot is the correct solution for them.

 >> I don't like us carrying feature patches in buildroot.

 Ulf> the "because" and the rest of the statement seems
 Ulf> to have been filtered away somewhere ;-)

Because we don't have enough ressources to maintain all the other
stuff as it is, without carrying (and maintaining/supporting/..) new
features to upstream projects.

Upstream development belongs in the upstream projects, not in
buildroot - Anything else doesn't scale in the long run.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:17 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:17 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:17:43 +0000 (Tue, 06 Jan 2009)
New Revision: 24703

Log:
Add 'mux' command to control ext mux on at91rm9200dk/ek

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-011-spimux.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-012-ethinit.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-013-configs.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-014-at572d940hfeb.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-016-cmd_mem.patch


Changeset:

Sorry, the patch is too large to include (4607 lines).
Please use ViewCVS to see it!

http://uclibc.org/cgi-bin/viewcvs.cgi?view=rev&root=svn&rev=24703

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:17 ulf at uclibc.org
  2009-01-06 16:32 ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:17 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:17:15 +0000 (Tue, 06 Jan 2009)
New Revision: 24702

Log:
Add 'led' command to control coloured LEDs

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-010-coloured_led.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-010-coloured_led.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-010-coloured_led.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-010-coloured_led.patch	2009-01-06 16:17:15 UTC (rev 24702)
@@ -0,0 +1,196 @@
+diff -urN u-boot-2009.01-0rig//common/cmd_led.c u-boot-2009.01/common/cmd_led.c
+--- u-boot-2009.01-0rig//common/cmd_led.c	1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2009.01/common/cmd_led.c	2009-01-03 23:39:57.000000000 +0100
+@@ -0,0 +1,84 @@
++/*
++ * (C) Copyright 2008
++ * Ulf Samuelsson <ulf.samuelsson@atmel.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
++ */
++
++/*
++ * This file provides a shell like 'test' function to return
++ * true/false from an integer or string compare of two memory
++ * locations or a location and a scalar/literal.
++ * A few parts were lifted from bash 'test' command
++ */
++
++#include <common.h>
++#include <config.h>
++#include <command.h>
++#include <coloured_led.h>
++
++int do_led ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
++{
++	int	led;
++	/* Validate arguments */
++	if ((argc != 3)){
++		printf("Usage:\n%s\n", cmdtp->usage);
++		return 1;
++	}
++	if (strcmp(argv[1], "1") == 0) {
++		led = (1 << 0);
++	} else if (strcmp(argv[1], "2") == 0) {
++		led = (1 << 1);
++	} else if (strcmp(argv[1], "3") == 0) {
++		led = (1 << 2);
++	} else if (strcmp(argv[1], "green") == 0) {
++		led = (1 << 0);
++	} else if (strcmp(argv[1], "yellow") == 0) {
++		led = (1 << 1);
++	} else if (strcmp(argv[1], "red") == 0) {
++		led = (1 << 2);
++	} else if (strcmp(argv[1], "all") == 0) {
++		led = 7;
++	} else {
++		printf ("Usage:\n%s\n", cmdtp->usage);
++		return 1;
++	}
++
++	if (strcmp(argv[2], "off") == 0) {
++		if(led & 1) green_LED_off();
++		if(led & 2) yellow_LED_off();
++		if(led & 4) red_LED_off();		
++	} else if (strcmp(argv[2], "on") == 0) {
++		if(led & 1) green_LED_on();
++		if(led & 2) yellow_LED_on();
++		if(led & 4) red_LED_on();		
++	} else {
++		printf ("Usage:\n%s\n", cmdtp->usage);
++		return 1;
++	}
++
++	return 0;
++}
++
++U_BOOT_CMD(
++	led, 3, 1, do_led,
++	"led\t- [1|2|3|green|yellow|red|all] [on|off]\n",
++	"led [1|2|3|green|yellow|red|all] [on|off] sets /clears led 1,2,3\n"
++);
++
+diff -urN u-boot-2009.01-0rig//common/Makefile u-boot-2009.01/common/Makefile
+--- u-boot-2009.01-0rig//common/Makefile	2009-01-02 21:18:24.000000000 +0100
++++ u-boot-2009.01/common/Makefile	2009-01-03 23:41:53.000000000 +0100
+@@ -99,6 +99,7 @@
+ COBJS-$(CONFIG_CMD_IRQ) += cmd_irq.o
+ COBJS-$(CONFIG_CMD_ITEST) += cmd_itest.o
+ COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
++COBJS-$(CONFIG_CMD_LED) += cmd_led.o
+ COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
+ COBJS-y += cmd_load.o
+ COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
+diff -urN u-boot-2009.01-0rig//include/coloured_led.h u-boot-2009.01/include/coloured_led.h
+--- u-boot-2009.01-0rig//include/coloured_led.h	1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2009.01/include/coloured_led.h	2009-01-03 23:39:19.000000000 +0100
+@@ -0,0 +1,62 @@
++/*
++ * (C) Copyright 2008
++ * Wolfgang Denk, DENX Software Engineering, wd at 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
++ */
++
++/*
++ * The purpose of this code is to signal the operational status of a
++ * target which usually boots over the network; while running in
++ * PCBoot, a status LED is blinking. As soon as a valid BOOTP reply
++ * message has been received, the LED is turned off. The Linux
++ * kernel, once it is running, will start blinking the LED again,
++ * with another frequency.
++ */
++
++#ifndef _COLOURED_LED_H_
++#define	_COLOURED_LED_H_
++
++#ifdef CONFIG_COLOURED_LED
++
++/*
++ * Coloured LEDs API
++ */
++#ifndef	__ASSEMBLY__
++extern void	coloured_LED_init (void);
++extern void	red_LED_on(void);
++extern void	red_LED_off(void);
++extern void	green_LED_on(void);
++extern void	green_LED_off(void);
++extern void	yellow_LED_on(void);
++extern void	yellow_LED_off(void);
++#else
++	.extern LED_init
++	.extern red_LED_on
++	.extern red_LED_off
++	.extern yellow_LED_on
++	.extern yellow_LED_off
++	.extern green_LED_on
++	.extern green_LED_off
++#endif
++
++#endif	/* CONFIG_COLOURED_LED	*/
++
++#endif	/* _STATUS_COLOURED_H_	*/
++
+diff -urN u-boot-2009.01-0rig//include/status_led.h u-boot-2009.01/include/status_led.h
+--- u-boot-2009.01-0rig//include/status_led.h	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/include/status_led.h	2009-01-03 23:44:40.000000000 +0100
+@@ -383,27 +383,6 @@
+ # include <asm/status_led.h>
+ #endif
+ 
+-/*
+- * Coloured LEDs API
+- */
+-#ifndef	__ASSEMBLY__
+-extern void	coloured_LED_init (void);
+-extern void	red_LED_on(void);
+-extern void	red_LED_off(void);
+-extern void	green_LED_on(void);
+-extern void	green_LED_off(void);
+-extern void	yellow_LED_on(void);
+-extern void	yellow_LED_off(void);
+-#else
+-	.extern LED_init
+-	.extern red_LED_on
+-	.extern red_LED_off
+-	.extern yellow_LED_on
+-	.extern yellow_LED_off
+-	.extern green_LED_on
+-	.extern green_LED_off
+-#endif
+-
+ #endif	/* CONFIG_STATUS_LED	*/
+ 
+ #endif	/* _STATUS_LED_H_	*/

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:13 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:13 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:13:08 +0000 (Tue, 06 Jan 2009)
New Revision: 24701

Log:
Remove an extra #endif from u-boot.factory

Modified:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch


Changeset:
Modified: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch	2009-01-06 16:10:56 UTC (rev 24700)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch	2009-01-06 16:13:08 UTC (rev 24701)
@@ -309,7 +309,7 @@
 +);
 +#endif /* #if	defined(CONFIG_LOAD_SCRIPTS) */
 +
-+#endif	/* CONFIG_DEFENV */
++
 diff -urN u-boot-2009.01-0rig//common/Makefile u-boot-2009.01/common/Makefile
 --- u-boot-2009.01-0rig//common/Makefile	2008-12-16 23:48:27.000000000 +0100
 +++ u-boot-2009.01/common/Makefile	2009-01-02 19:17:16.000000000 +0100

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:10 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:10 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:10:56 +0000 (Tue, 06 Jan 2009)
New Revision: 24700

Log:
Fix some CFG/CONFIG related problems for AT91RM9200 configuration of U-Boot

Modified:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-002-at91rm9200dk.h.patch
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-004-at91rm9200ek.patch


Changeset:
Modified: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-002-at91rm9200dk.h.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-002-at91rm9200dk.h.patch	2009-01-06 16:09:53 UTC (rev 24699)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-002-at91rm9200dk.h.patch	2009-01-06 16:10:56 UTC (rev 24700)
@@ -182,7 +182,7 @@
 +#define CONFIG_SYS_MAX_DATAFLASH_PAGES		16384
 +#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* Logical adress for CS0 */
 +#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3	0xD0000000	/* Logical adress for CS3 */
-+#define	CFG_SUPPORT_BLOCK_ERASE		1
++#define CONFIG__SUPPORT_BLOCK_ERASE		1
 +
 +
 +#define PHYS_FLASH_1			0x10000000

Modified: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-004-at91rm9200ek.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-004-at91rm9200ek.patch	2009-01-06 16:09:53 UTC (rev 24699)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-004-at91rm9200ek.patch	2009-01-06 16:10:56 UTC (rev 24700)
@@ -133,8 +133,8 @@
 +#define CONFIG_DOS_PARTITION		1
 +#define CONFIG_MMC			1
 +#define CONFIG_SUPPORT_VFAT		1
-+#define CFG_MMC_BASE			0xFFFB4000	/* From AT91RM9200.h*/
-+#define CFG_MMC_BLOCKSIZE		512
++#define CONFIG__MMC_BASE			0xFFFB4000	/* From AT91RM9200.h*/
++#define CONFIG__MMC_BLOCKSIZE		512
 +
 +#define CONFIG_NAND_LEGACY
 +
@@ -185,14 +185,14 @@
 +#define DATAFLASH_TCHS	(0x1 << 24)
 +
 +#define CONFIG_HAS_DATAFLASH		1
-+#define BOARD_LATE_INIT			1
++#undef BOARD_LATE_INIT
 +
 +#define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
 +#define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
 +#define CONFIG_SYS_MAX_DATAFLASH_PAGES		16384
 +#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* Logical adress for CS0 */
 +#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3	0xD0000000	/* Logical adress for CS3 */
-+#define	CFG_SUPPORT_BLOCK_ERASE		1
++#define CONFIG__SUPPORT_BLOCK_ERASE		1
 +
 +#define PHYS_FLASH_1			0x10000000
 +#define PHYS_FLASH_SIZE			0x800000  /* 2 megs main flash */
@@ -447,7 +447,7 @@
 +#define CONFIG_SYS_MAX_DATAFLASH_PAGES		16384
 +#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* Logical adress for CS0 */
 +#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3	0xD0000000	/* Logical adress for CS3 */
-+#define	CFG_SUPPORT_BLOCK_ERASE		1
++#define CONFIG__SUPPORT_BLOCK_ERASE		1
 +
 +#define PHYS_FLASH_1			0x10000000
 +#define PHYS_FLASH_SIZE			0x800000  /* 2 megs main flash */
@@ -462,9 +462,9 @@
 +
 +#ifdef CONFIG_ENV_IS_IN_DATAFLASH
 +#ifdef	CONFIG_NEW_PARTITION		
-+#define CFG_ENV_OFFSET			0x21000
-+#define CFG_ENV_ADDR			(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
-+#define CFG_ENV_SIZE			0x2000  /* 8 * 1056 really , but start.s is not OK with this*/
++#define CONFIG__ENV_OFFSET			0x21000
++#define CONFIG__ENV_ADDR			(CONFIG_SYS__DATAFLASH_LOGIC_ADDR_CS0 + CONFIG__ENV_OFFSET)
++#define CONFIG__ENV_SIZE			0x2000  /* 8 * 1056 really , but start.s is not OK with this*/
 +> #else
 +#define CONFIG_ENV_OFFSET		0x20000
 +#define CONFIG_ENV_ADDR			(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-06 16:09 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-06 16:09 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-06 16:09:53 +0000 (Tue, 06 Jan 2009)
New Revision: 24699

Log:
Use the correct sam9g20 patch for 2009.01-rc1

Modified:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch


Changeset:
Modified: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch	2009-01-06 14:40:24 UTC (rev 24698)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch	2009-01-06 16:09:53 UTC (rev 24699)
@@ -10,13 +10,13 @@
 +at91sam9g20ek_dataflash_cs1_config \
 +at91sam9g20ek_config	:	unconfig
 +	@if [ "$(findstring _nandflash,$@)" ] ; then \
-+		echo "#define CFG_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
++		echo "#define CONFIG_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
 +		$(XECHO) "... with environment variable in NAND FLASH" ; \
 +	elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
-+		echo "#define CFG_USE_DATAFLASH_CS0 1"	>>$(obj)include/config.h ; \
++		echo "#define CONFIG_USE_DATAFLASH_CS0 1"	>>$(obj)include/config.h ; \
 +		$(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
 +	else \
-+		echo "#define CFG_USE_DATAFLASH_CS1 1"	>>$(obj)include/config.h ; \
++		echo "#define CONFIG_USE_DATAFLASH_CS1 1"	>>$(obj)include/config.h ; \
 +		$(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; \
 +	fi;
 +	@$(MKCONFIG) -a at91sam9g20ek arm arm926ejs at91sam9g20ek atmel at91
@@ -61,7 +61,7 @@
 +/* ARM asynchronous clock */
 +#define AT91_MAIN_CLOCK		396288000	/* from 18.432 MHz crystal */
 +#define AT91_MASTER_CLOCK	132096000	/* peripheral = main / 3 */
-+#define CFG_HZ			1000000		/* 1us resolution */
++#define CONFIG_SYS_HZ			1000000		/* 1us resolution */
 +
 +#define AT91_SLOW_CLOCK		32768	/* slow clock */
 +
@@ -109,7 +109,7 @@
 +
 +#define CONFIG_CMD_PING		1
 +#define CONFIG_CMD_DHCP		1
-+#define CONFIG_CMD_NAND		1
++#define CONFIG_CMD_NAND
 +#define CONFIG_CMD_USB		1
 +
 +/* SDRAM */
@@ -119,22 +119,22 @@
 +
 +/* DataFlash */
 +#define CONFIG_HAS_DATAFLASH		1
-+#define CFG_SPI_WRITE_TOUT		(5*CFG_HZ)
-+#define CFG_MAX_DATAFLASH_BANKS		2
-+#define CFG_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
-+#define CFG_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
++#define CONFIG_SYS_SPI_WRITE_TOUT		(5*CONFIG_SYS_HZ)
++#define CONFIG_SYS_MAX_DATAFLASH_BANKS		2
++#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
++#define CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
 +#define AT91_SPI_CLK			15000000
 +#define DATAFLASH_TCSS			(0x22 << 16)
 +#define DATAFLASH_TCHS			(0x1 << 24)
-+
++#define AT91SAM9260_BASE_SPI0		0xfffc8000
 +/* NAND flash */
 +#define NAND_MAX_CHIPS			1
-+#define CFG_MAX_NAND_DEVICE		1
-+#define CFG_NAND_BASE			0x40000000
-+#define CFG_NAND_DBW_8			1
++#define CONFIG_SYS_MAX_NAND_DEVICE		1
++#define CONFIG_SYS_NAND_BASE			0x40000000
++#define CONFIG_SYS_NAND_DBW_8			1
 +
 +/* NOR flash - no real flash on this board */
-+#define CFG_NO_FLASH			1
++#define CONFIG_SYS_NO_FLASH			1
 +
 +/* Ethernet */
 +#define CONFIG_MACB			1
@@ -142,57 +142,57 @@
 +#define CONFIG_NET_MULTI		1
 +#define CONFIG_NET_RETRY_COUNT		20
 +#define CONFIG_RESET_PHY_R		1
-+
++#define AT91SAM9260_BASE_EMAC		0xfffc4000
 +/* USB */
 +#define CONFIG_USB_OHCI_NEW		1
 +#define LITTLEENDIAN			1
 +#define CONFIG_DOS_PARTITION		1
-+#define CFG_USB_OHCI_CPU_INIT		1
-+#define CFG_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9G20_UHP_BASE */
-+#define CFG_USB_OHCI_SLOT_NAME		"at91sam9g20"
-+#define CFG_USB_OHCI_MAX_ROOT_PORTS	2
++#define CONFIG_SYS_USB_OHCI_CPU_INIT		1
++#define CONFIG_SYS_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9G20_UHP_BASE */
++#define CONFIG_SYS_USB_OHCI_SLOT_NAME		"at91sam9g20"
++#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS	2
 +#define CONFIG_USB_STORAGE		1
 +
-+#define CFG_LOAD_ADDR			0x22000000	/* load address */
++#define CONFIG_SYS_LOAD_ADDR			0x22000000	/* load address */
 +
-+#define CFG_MEMTEST_START		PHYS_SDRAM
-+#define CFG_MEMTEST_END			0x23e00000
++#define CONFIG_SYS_MEMTEST_START		PHYS_SDRAM
++#define CONFIG_SYS_MEMTEST_END			0x23e00000
 +
-+#ifdef CFG_USE_DATAFLASH_CS0
++#ifdef CONFIG_USE_DATAFLASH_CS0
 +
 +/* bootstrap + u-boot + env + linux in dataflash on CS0 */
-+#define CFG_ENV_IS_IN_DATAFLASH	1
-+#define CFG_MONITOR_BASE	(CFG_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-+#define CFG_ENV_OFFSET		0x4200
-+#define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
-+#define CFG_ENV_SIZE		0x4200
++#define CONFIG_ENV_IS_IN_DATAFLASH	1
++#define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
++#define CONFIG_ENV_OFFSET		0x4200
++#define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
++#define CONFIG_ENV_SIZE		0x4200
 +#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
 +#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 +				"root=/dev/mtdblock0 "			\
 +				"mtdparts=at91_nand:-(root) "		\
 +				"rw rootfstype=jffs2"
 +
-+#elif CFG_USE_DATAFLASH_CS1
++#elif CONFIG_USE_DATAFLASH_CS1
 +
 +/* bootstrap + u-boot + env + linux in dataflash on CS1 */
-+#define CFG_ENV_IS_IN_DATAFLASH	1
-+#define CFG_MONITOR_BASE	(CFG_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
-+#define CFG_ENV_OFFSET		0x4200
-+#define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS1 + CFG_ENV_OFFSET)
-+#define CFG_ENV_SIZE		0x4200
++#define CONFIG_ENV_IS_IN_DATAFLASH	1
++#define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
++#define CONFIG_ENV_OFFSET		0x4200
++#define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
++#define CONFIG_ENV_SIZE		0x4200
 +#define CONFIG_BOOTCOMMAND	"cp.b 0xD0042000 0x22000000 0x210000; bootm"
 +#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 +				"root=/dev/mtdblock0 "			\
 +				"mtdparts=at91_nand:-(root) "		\
 +				"rw rootfstype=jffs2"
 +
-+#else /* CFG_USE_NANDFLASH */
++#else /* CONFIG_USE_NANDFLASH */
 +
 +/* bootstrap + u-boot + env + linux in nandflash */
-+#define CFG_ENV_IS_IN_NAND	1
-+#define CFG_ENV_OFFSET		0x60000
-+#define CFG_ENV_OFFSET_REDUND	0x80000
-+#define CFG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
++#define CONFIG_ENV_IS_IN_NAND	1
++#define CONFIG_ENV_OFFSET		0x60000
++#define CONFIG_ENV_OFFSET_REDUND	0x80000
++#define CONFIG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
 +#define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0xA0000 0x200000; bootm"
 +#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 +				"root=/dev/mtdblock5 "			\
@@ -204,21 +204,21 @@
 +#endif
 +
 +#define CONFIG_BAUDRATE		115200
-+#define CFG_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
++#define CONFIG_SYS_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
 +
-+#define CFG_PROMPT		"U-Boot> "
-+#define CFG_CBSIZE		256
-+#define CFG_MAXARGS		16
-+#define CFG_PBSIZE		(CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
-+#define CFG_LONGHELP		1
++#define CONFIG_SYS_PROMPT		"U-Boot> "
++#define CONFIG_SYS_CBSIZE		256
++#define CONFIG_SYS_MAXARGS		16
++#define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
++#define CONFIG_SYS_LONGHELP		1
 +#define CONFIG_CMDLINE_EDITING	1
 +
 +#define ROUND(A, B)		(((A) + (B)) & ~((B) - 1))
 +/*
 + * Size of malloc() pool
 + */
-+#define CFG_MALLOC_LEN		ROUND(3 * CFG_ENV_SIZE + 128*1024, 0x1000)
-+#define CFG_GBL_DATA_SIZE	128	/* 128 bytes for initial data */
++#define CONFIG_SYS_MALLOC_LEN		ROUND(3 * CONFIG_ENV_SIZE + 128*1024, 0x1000)
++#define CONFIG_SYS_GBL_DATA_SIZE	128	/* 128 bytes for initial data */
 +
 +#define CONFIG_STACKSIZE	(32*1024)	/* regular stack */
 +
@@ -231,7 +231,7 @@
 ===================================================================
 --- a/board/atmel/at91sam9g20ek/nand.c	(.../u-boot-1.3.4)	(revision 0)
 +++ b/board/atmel/at91sam9g20ek/nand.c	(.../u-boot-1.3.4-exp)	(revision 8417)
-@@ -0,0 +1,79 @@
+@@ -0,0 +1,78 @@
 +/*
 + * (C) Copyright 2007-2008
 + * Stelian Pop <stelian.pop@leadtechdesign.com>
@@ -271,27 +271,26 @@
 +#define	MASK_ALE	(1 << 21)	/* our ALE is AD21 */
 +#define	MASK_CLE	(1 << 22)	/* our CLE is AD22 */
 +
-+static void at91sam9g20ek_nand_hwcontrol(struct mtd_info *mtd, int cmd)
++static void at91sam9g20ek_nand_hwcontrol(struct mtd_info *mtd,
++					 int cmd, unsigned int ctrl)
 +{
 +	struct nand_chip *this = mtd->priv;
-+	ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
 +
-+	IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
-+	switch (cmd) {
-+	case NAND_CTL_SETCLE:
-+		IO_ADDR_W |= MASK_CLE;
-+		break;
-+	case NAND_CTL_SETALE:
-+		IO_ADDR_W |= MASK_ALE;
-+		break;
-+	case NAND_CTL_CLRNCE:
-+		at91_set_gpio_value(AT91_PIN_PC14, 1);
-+		break;
-+	case NAND_CTL_SETNCE:
-+		at91_set_gpio_value(AT91_PIN_PC14, 0);
-+		break;
++	if (ctrl & NAND_CTRL_CHANGE) {
++		ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
++		IO_ADDR_W &= ~(MASK_ALE | MASK_CLE);
++
++		if (ctrl & NAND_CLE)
++			IO_ADDR_W |= MASK_CLE;
++		if (ctrl & NAND_ALE)
++			IO_ADDR_W |= MASK_ALE;
++
++		at91_set_gpio_value(AT91_PIN_PC14, !(ctrl & NAND_NCE));
++		this->IO_ADDR_W = (void *) IO_ADDR_W;
 +	}
-+	this->IO_ADDR_W = (void *) IO_ADDR_W;
++
++	if (cmd != NAND_CMD_NONE)
++		writeb(cmd, this->IO_ADDR_W);
 +}
 +
 +static int at91sam9g20ek_nand_ready(struct mtd_info *mtd)
@@ -301,11 +300,11 @@
 +
 +int board_nand_init(struct nand_chip *nand)
 +{
-+	nand->eccmode = NAND_ECC_SOFT;
-+#ifdef CFG_NAND_DBW_16
++	nand->ecc.mode = NAND_ECC_SOFT;
++#ifdef CONFIG_SYS_NAND_DBW_16
 +	nand->options = NAND_BUSWIDTH_16;
 +#endif
-+	nand->hwcontrol = at91sam9g20ek_nand_hwcontrol;
++	nand->cmd_ctrl = at91sam9g20ek_nand_hwcontrol;
 +	nand->dev_ready = at91sam9g20ek_nand_ready;
 +	nand->chip_delay = 20;
 +
@@ -351,7 +350,7 @@
 +#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
 +#include <net.h>
 +#endif
-+
++#include <netdev.h>
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +/* ------------------------------------------------------------------------- */
@@ -408,9 +407,9 @@
 +	at91_sys_write(AT91_SMC_MODE(3),
 +		       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
 +		       AT91_SMC_EXNWMODE_DISABLE |
-+#ifdef CFG_NAND_DBW_16
++#ifdef CONFIG_SYS_NAND_DBW_16
 +		       AT91_SMC_DBW_16 |
-+#else /* CFG_NAND_DBW_8 */
++#else /* CONFIG_SYS_NAND_DBW_8 */
 +		       AT91_SMC_DBW_8 |
 +#endif
 +		       AT91_SMC_TDF_(3));
@@ -665,11 +664,11 @@
 +#include <asm/hardware.h>
 +#include <dataflash.h>
 +
-+AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
++AT91S_DATAFLASH_INFO dataflash_info[CONFIG_SYS_MAX_DATAFLASH_BANKS];
 +
-+struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
-+	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
-+	{CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
++struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS] = {
++	{CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
++	{CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1, 1}
 +};
 +
 +/*define the area offsets*/
@@ -795,7 +794,7 @@
 +{
 +	int rc = 0;
 +#ifdef CONFIG_MACB
-+	rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
++	rc = macb_eth_initialize(0, (void *)AT91SAM9260_BASE_EMAC, 0x00);
 +#endif
 +	return rc;
 +}

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 15:28     ` Peter Korsgaard
@ 2009-01-06 16:03       ` Ulf Samuelsson
  0 siblings, 0 replies; 26+ messages in thread
From: Ulf Samuelsson @ 2009-01-06 16:03 UTC (permalink / raw)
  To: buildroot

tis 2009-01-06 klockan 16:28 +0100 skrev Peter Korsgaard:
> >>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:
> 
>  ulf> Provide factory default command to u-boot, using Buildroot variables
>  >> 
>  ulf> Added:
>  ulf> trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch
>  >> 
>  >> Do we really need this? What's the upstream status of it?
> 
>  Ulf> I find that this patch reduces maintenance A LOT.
>  Ulf> If someone calls in with a problem loading linux,
>  Ulf> then you tell them to do "factory"  and then 
>  Ulf> everything is SO much easier.
> 
> But what's the difference between this command and a factory
> environment variable which just erases your environment and resets the
> board?
> 

It sets up a number of environment variables,
depending on the buildroot configuration for u-boot.


> If you really need it for Atmel stuff, maybe you should keep it in the
> Atmel fork?
> 

I think beeing able to reset the environment to a known 
board specific default is useful for everyone.
If it is available for PCs, why is it a bad idea for U-boot?
That does not mean that there is no room for improvement
on the actual implementation.

You have to explicitly enable this in your board config,
so noone should be hurt by the patch.


The plan is to remove the Atmel specific U-Boot soon.
(It is already removed from Kconfig)

BR
Ulf Samuelsson

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 15:26     ` Peter Korsgaard
@ 2009-01-06 15:56       ` Ulf Samuelsson
  2009-01-06 16:18         ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: Ulf Samuelsson @ 2009-01-06 15:56 UTC (permalink / raw)
  To: buildroot

tis 2009-01-06 klockan 16:26 +0100 skrev Peter Korsgaard:
> >>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:
> 
> Hi,
> 
>  Ulf> I discovered I made a mistake and checked in the
>  Ulf> 1.3.4 patch so it will be updated later today
> 
>  Ulf> The original is part of the atmel 1.3.4 patch freom www.linux4sam.org
> 
> Why is that not in mainline U-Boot?
> 


>  Ulf> ?There will be some other fixes due to the CFG->CONFIG(_SYS)
> 
> Yes, that's what I mentioned last week. This again will complicate
> stuff when we're supporting 3+ U-Boot versions.
> 

I only submit the patches to the 2009.01-rc1 directory,

Contary on my opinion on linux, I do not mind if we
obsolete older u-boot versions, like 1.3.4.
Also, I am not hurt if we keep it.

I did not want to remove that myself because I know the
hassle depreciation can cause.
It also made sense to have the last stable version,
as well as the development version available.
?UNless someone disagrees, 
I plan to move to 2009.01 when available and delete 2009.01-rc1


??Other may want to keep older u-boot versions, 
but need to voice that opinion.
So far only you have commented the new u-boot.

----
Generally U-Boot should have much less priority 
or deprecation than the contents of the root file system, 
because it has a very simple API if you use the vanilla version
and has zero dependency on the root fs.

make <board>_config
make

Hard to go wrong, if the toolchain works.


>  Ulf> I have tested the new patches to build for all possible AT91 targets
>  Ulf> in buildroot as well as for a PowerPC target.
> 
>  Ulf> Generally on patches to u-boot:
>  Ulf> The AT91 team got zero response from the U-Boot during 2003-2005
>  Ulf> so they dropped all attempts to submit new stuff.
> 
> They just have to try again like the rest of us, or maybe ping wdenx
> on irc.

That is what they are doing now, but the SAM9G20 support is
too new to have been submitted to trunk.
It is done for 1.3.4 but can not be submitted to
2009.01-rc1 dues to the changes CFG->CONFIG.

> I know he can be a pain, but that's his job.
> 
>  Ulf> After it was decided to split the responsibilities up
>  Ulf> to several people, the submission process has improved a lot, 
>  Ulf> so the AT91 team started to be interested again last year.
>  Ulf> The board support for AT91 processors has improved.
>  Ulf> The AT91RM9200 has less priority on support from the product line
>  Ulf> and has therefore not been submitted, even if patches
>  Ulf> has been available for a long time.
> 
>  Ulf> Currently the merge window is closed, but I expect
>  Ulf> to submit the board support patches and some of the
>  Ulf> new commands end of January.
> 
> Ok, please do so. There's afaik nothing stopping you from submitting
> patches now so they can be integrated by the arm/at91 subtree
> maintainer.

I did submit a patch outside the merge window some time ago,
and then I did not feel that was appreciated,
but that was maybe before the custodian concept was 
fully established.



>  Ulf> The factory default command relies heavily on
>  Ulf> the buildroot configuration, so it may make less
>  Ulf> sense to include that in the main u-boot trunk.
> 
> What's the point of it? Is it any different than simply erasing the
> environment and resetting the board?

Yes, once you run the "factory" command, your environment
is set up so you can download and flash the kernel and rootfs
with a simple command.
You also have the bootcmd and bootargs set up properly
based on which root file system type you have.
If you care to enter the setup on your PC,
then you will most likely notice a possibility
to reset to factory defaults.
U-Boot does not support this at the momemnt.
It supports downloading an autoscript
or compile time defaults.
Once you are away from your development environment
and has changed the environment, you are screwed.

It is especially useful for newbies which have zero
experience with linux/u-boot.
I have several hundred companies working on AT91 
stuff in my region, many of them complete newbies.
I need to support them all, and if things are difficult,
it will simply fall to pieces.

Would you hand a board over to your grandmother
and then help her over the phone to boot linux?
It really needs to be so simple that this
approach has a fair chance of succeeding.



> I don't like us carrying feature patches in buildroot.

the "because" and the rest of the statement seems
to have been filtered away somewhere ;-)


> 
> -- 
> Bye, Peter Korsgaard
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 15:20   ` Ulf Samuelsson
@ 2009-01-06 15:28     ` Peter Korsgaard
  2009-01-06 16:03       ` Ulf Samuelsson
  0 siblings, 1 reply; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 15:28 UTC (permalink / raw)
  To: buildroot

>>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:

 ulf> Provide factory default command to u-boot, using Buildroot variables
 >> 
 ulf> Added:
 ulf> trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch
 >> 
 >> Do we really need this? What's the upstream status of it?

 Ulf> I find that this patch reduces maintenance A LOT.
 Ulf> If someone calls in with a problem loading linux,
 Ulf> then you tell them to do "factory"  and then 
 Ulf> everything is SO much easier.

But what's the difference between this command and a factory
environment variable which just erases your environment and resets the
board?

If you really need it for Atmel stuff, maybe you should keep it in the
Atmel fork?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 15:16   ` Ulf Samuelsson
@ 2009-01-06 15:26     ` Peter Korsgaard
  2009-01-06 15:56       ` Ulf Samuelsson
  0 siblings, 1 reply; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 15:26 UTC (permalink / raw)
  To: buildroot

>>>>> "Ulf" == Ulf Samuelsson <ulf.samuelsson@atmel.com> writes:

Hi,

 Ulf> I discovered I made a mistake and checked in the
 Ulf> 1.3.4 patch so it will be updated later today

 Ulf> The original is part of the atmel 1.3.4 patch freom www.linux4sam.org

Why is that not in mainline U-Boot?

 Ulf> ?There will be some other fixes due to the CFG->CONFIG(_SYS)

Yes, that's what I mentioned last week. This again will complicate
stuff when we're supporting 3+ U-Boot versions.

 Ulf> I have tested the new patches to build for all possible AT91 targets
 Ulf> in buildroot as well as for a PowerPC target.

 Ulf> Generally on patches to u-boot:
 Ulf> The AT91 team got zero response from the U-Boot during 2003-2005
 Ulf> so they dropped all attempts to submit new stuff.

They just have to try again like the rest of us, or maybe ping wdenx
on irc.

I know he can be a pain, but that's his job.

 Ulf> After it was decided to split the responsibilities up
 Ulf> to several people, the submission process has improved a lot, 
 Ulf> so the AT91 team started to be interested again last year.
 Ulf> The board support for AT91 processors has improved.
 Ulf> The AT91RM9200 has less priority on support from the product line
 Ulf> and has therefore not been submitted, even if patches
 Ulf> has been available for a long time.

 Ulf> Currently the merge window is closed, but I expect
 Ulf> to submit the board support patches and some of the
 Ulf> new commands end of January.

Ok, please do so. There's afaik nothing stopping you from submitting
patches now so they can be integrated by the arm/at91 subtree
maintainer.

 Ulf> The factory default command relies heavily on
 Ulf> the buildroot configuration, so it may make less
 Ulf> sense to include that in the main u-boot trunk.

What's the point of it? Is it any different than simply erasing the
environment and resetting the board?

I don't like us carrying feature patches in buildroot.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 14:39 ` Peter Korsgaard
@ 2009-01-06 15:20   ` Ulf Samuelsson
  2009-01-06 15:28     ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: Ulf Samuelsson @ 2009-01-06 15:20 UTC (permalink / raw)
  To: buildroot

tis 2009-01-06 klockan 15:39 +0100 skrev Peter Korsgaard:
> >>>>> "ulf" == ulf  <ulf@uclibc.org> writes:
> 
>  ulf> Author: ulf
>  ulf> Date: 2009-01-03 00:04:55 +0000 (Sat, 03 Jan 2009)
>  ulf> New Revision: 24656
> 
>  ulf> Log:
>  ulf> Provide factory default command to u-boot, using Buildroot variables
> 
>  ulf> Added:
>  ulf>    trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch
> 
> Do we really need this? What's the upstream status of it?

I find that this patch reduces maintenance A LOT.
If someone calls in with a problem loading linux,
then you tell them to do "factory"  and then 
everything is SO much easier.

Since it depends heavily on buildroot configuration, 
it makes little sense for this to propagate to upstream.

> 
> I would very much like to limit the number of patches to the minimum
> (E.G. bugfixes, needed hardware support), and this doesn't look like
> either to those.
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-06 14:37 ` Peter Korsgaard
@ 2009-01-06 15:16   ` Ulf Samuelsson
  2009-01-06 15:26     ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: Ulf Samuelsson @ 2009-01-06 15:16 UTC (permalink / raw)
  To: buildroot

tis 2009-01-06 klockan 15:37 +0100 skrev Peter Korsgaard:
> >>>>> "ulf" == ulf  <ulf@uclibc.org> writes:
> 
>  ulf> Author: ulf
>  ulf> Date: 2009-01-03 00:06:13 +0000 (Sat, 03 Jan 2009)
>  ulf> New Revision: 24658
> 

I discovered I made a mistake and checked in the
1.3.4 patch so it will be updated later today

The original is part of the atmel 1.3.4 patch freom www.linux4sam.org

?There will be some other fixes due to the CFG->CONFIG(_SYS)
I have tested the new patches to build for all possible AT91 targets
in buildroot as well as for a PowerPC target.

Generally on patches to u-boot:
The AT91 team got zero response from the U-Boot during 2003-2005
so they dropped all attempts to submit new stuff.
After it was decided to split the responsibilities up
to several people, the submission process has improved a lot, 
so the AT91 team started to be interested again last year.
The board support for AT91 processors has improved.
The AT91RM9200 has less priority on support from the product line
and has therefore not been submitted, even if patches
has been available for a long time.

Currently the merge window is closed, but I expect
to submit the board support patches and some of the
new commands end of January.

The factory default command relies heavily on
the buildroot configuration, so it may make less
sense to include that in the main u-boot trunk.


>  ulf> Log:
>  ulf> Add support for at91sam9g20 to U-Boot
> 
> What's the upstream status of this patch?
> 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-03  0:04 ulf at uclibc.org
@ 2009-01-06 14:39 ` Peter Korsgaard
  2009-01-06 15:20   ` Ulf Samuelsson
  0 siblings, 1 reply; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 14:39 UTC (permalink / raw)
  To: buildroot

>>>>> "ulf" == ulf  <ulf@uclibc.org> writes:

 ulf> Author: ulf
 ulf> Date: 2009-01-03 00:04:55 +0000 (Sat, 03 Jan 2009)
 ulf> New Revision: 24656

 ulf> Log:
 ulf> Provide factory default command to u-boot, using Buildroot variables

 ulf> Added:
 ulf>    trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch

Do we really need this? What's the upstream status of it?

I would very much like to limit the number of patches to the minimum
(E.G. bugfixes, needed hardware support), and this doesn't look like
either to those.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
  2009-01-03  0:06 ulf at uclibc.org
@ 2009-01-06 14:37 ` Peter Korsgaard
  2009-01-06 15:16   ` Ulf Samuelsson
  0 siblings, 1 reply; 26+ messages in thread
From: Peter Korsgaard @ 2009-01-06 14:37 UTC (permalink / raw)
  To: buildroot

>>>>> "ulf" == ulf  <ulf@uclibc.org> writes:

 ulf> Author: ulf
 ulf> Date: 2009-01-03 00:06:13 +0000 (Sat, 03 Jan 2009)
 ulf> New Revision: 24658

 ulf> Log:
 ulf> Add support for at91sam9g20 to U-Boot

What's the upstream status of this patch?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-03  0:06 ulf at uclibc.org
  2009-01-06 14:37 ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-03  0:06 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-03 00:06:13 +0000 (Sat, 03 Jan 2009)
New Revision: 24658

Log:
Add support for at91sam9g20 to U-Boot

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-005-at91sam9g20ek.patch	2009-01-03 00:06:13 UTC (rev 24658)
@@ -0,0 +1,802 @@
+diff -urN u-boot-2008.10-0rig/Makefile u-boot-2008.10/Makefile
+--- u-boot-2008.10-0rig/Makefile	2008-12-28 14:07:30.000000000 +0100
++++ u-boot-2008.10/Makefile	2008-12-28 14:06:28.000000000 +0100
+@@ -2541,6 +2541,22 @@
+ 	fi;
+ 	@$(MKCONFIG) -n at91sam9xeek -a at91sam9260ek arm arm926ejs at91sam9260ek atmel at91
+ 
++at91sam9g20ek_nandflash_config \
++at91sam9g20ek_dataflash_cs0_config \
++at91sam9g20ek_dataflash_cs1_config \
++at91sam9g20ek_config	:	unconfig
++	@if [ "$(findstring _nandflash,$@)" ] ; then \
++		echo "#define CFG_USE_NANDFLASH 1"	>>$(obj)include/config.h ; \
++		$(XECHO) "... with environment variable in NAND FLASH" ; \
++	elif [ "$(findstring dataflash_cs0,$@)" ] ; then \
++		echo "#define CFG_USE_DATAFLASH_CS0 1"	>>$(obj)include/config.h ; \
++		$(XECHO) "... with environment variable in SPI DATAFLASH CS0" ; \
++	else \
++		echo "#define CFG_USE_DATAFLASH_CS1 1"	>>$(obj)include/config.h ; \
++		$(XECHO) "... with environment variable in SPI DATAFLASH CS1" ; \
++	fi;
++	@$(MKCONFIG) -a at91sam9g20ek arm arm926ejs at91sam9g20ek atmel at91
++
+ at91sam9261ek_nandflash_config \
+ at91sam9261ek_dataflash_cs0_config \
+ at91sam9261ek_dataflash_cs3_config \
+Index: include/configs/at91sam9g20ek.h
+===================================================================
+--- a/include/configs/at91sam9g20ek.h	(.../u-boot-1.3.4)	(revision 0)
++++ b/include/configs/at91sam9g20ek.h	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1,198 @@
++/*
++ * (C) Copyright 2007-2008
++ * Stelian Pop <stelian.pop@leadtechdesign.com>
++ * Lead Tech Design <www.leadtechdesign.com>
++ *
++ * Configuation settings for the AT91SAM9G20EK board.
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#ifndef __CONFIG_H
++#define __CONFIG_H
++
++/* ARM asynchronous clock */
++#define AT91_MAIN_CLOCK		396288000	/* from 18.432 MHz crystal */
++#define AT91_MASTER_CLOCK	132096000	/* peripheral = main / 3 */
++#define CFG_HZ			1000000		/* 1us resolution */
++
++#define AT91_SLOW_CLOCK		32768	/* slow clock */
++
++#define CONFIG_ARM926EJS	1	/* This is an ARM926EJS Core	*/
++#define CONFIG_AT91SAM9G20	1	/* It's an Atmel AT91SAM9G20 SoC*/
++#define CONFIG_AT91SAM9G20EK	1	/* on an AT91SAM9G20EK Board	*/
++#undef CONFIG_USE_IRQ			/* we don't need IRQ/FIQ stuff	*/
++
++#define CONFIG_CMDLINE_TAG	1	/* enable passing of ATAGs	*/
++#define CONFIG_SETUP_MEMORY_TAGS 1
++#define CONFIG_INITRD_TAG	1
++
++#define CONFIG_SKIP_LOWLEVEL_INIT
++#define CONFIG_SKIP_RELOCATE_UBOOT
++
++/*
++ * Hardware drivers
++ */
++#define CONFIG_ATMEL_USART	1
++#undef CONFIG_USART0
++#undef CONFIG_USART1
++#undef CONFIG_USART2
++#define CONFIG_USART3		1	/* USART 3 is DBGU */
++
++#define CONFIG_BOOTDELAY	3
++
++/*
++ * BOOTP options
++ */
++#define CONFIG_BOOTP_BOOTFILESIZE	1
++#define CONFIG_BOOTP_BOOTPATH		1
++#define CONFIG_BOOTP_GATEWAY		1
++#define CONFIG_BOOTP_HOSTNAME		1
++
++/*
++ * Command line configuration.
++ */
++#include <config_cmd_default.h>
++#undef CONFIG_CMD_BDI
++#undef CONFIG_CMD_IMI
++#undef CONFIG_CMD_AUTOSCRIPT
++#undef CONFIG_CMD_FPGA
++#undef CONFIG_CMD_LOADS
++#undef CONFIG_CMD_IMLS
++
++#define CONFIG_CMD_PING		1
++#define CONFIG_CMD_DHCP		1
++#define CONFIG_CMD_NAND		1
++#define CONFIG_CMD_USB		1
++
++/* SDRAM */
++#define CONFIG_NR_DRAM_BANKS		1
++#define PHYS_SDRAM			0x20000000
++#define PHYS_SDRAM_SIZE			0x04000000	/* 64 megs */
++
++/* DataFlash */
++#define CONFIG_HAS_DATAFLASH		1
++#define CFG_SPI_WRITE_TOUT		(5*CFG_HZ)
++#define CFG_MAX_DATAFLASH_BANKS		2
++#define CFG_DATAFLASH_LOGIC_ADDR_CS0	0xC0000000	/* CS0 */
++#define CFG_DATAFLASH_LOGIC_ADDR_CS1	0xD0000000	/* CS1 */
++#define AT91_SPI_CLK			15000000
++#define DATAFLASH_TCSS			(0x22 << 16)
++#define DATAFLASH_TCHS			(0x1 << 24)
++
++/* NAND flash */
++#define NAND_MAX_CHIPS			1
++#define CFG_MAX_NAND_DEVICE		1
++#define CFG_NAND_BASE			0x40000000
++#define CFG_NAND_DBW_8			1
++
++/* NOR flash - no real flash on this board */
++#define CFG_NO_FLASH			1
++
++/* Ethernet */
++#define CONFIG_MACB			1
++#define CONFIG_RMII			1
++#define CONFIG_NET_MULTI		1
++#define CONFIG_NET_RETRY_COUNT		20
++#define CONFIG_RESET_PHY_R		1
++
++/* USB */
++#define CONFIG_USB_OHCI_NEW		1
++#define LITTLEENDIAN			1
++#define CONFIG_DOS_PARTITION		1
++#define CFG_USB_OHCI_CPU_INIT		1
++#define CFG_USB_OHCI_REGS_BASE		0x00500000	/* AT91SAM9G20_UHP_BASE */
++#define CFG_USB_OHCI_SLOT_NAME		"at91sam9g20"
++#define CFG_USB_OHCI_MAX_ROOT_PORTS	2
++#define CONFIG_USB_STORAGE		1
++
++#define CFG_LOAD_ADDR			0x22000000	/* load address */
++
++#define CFG_MEMTEST_START		PHYS_SDRAM
++#define CFG_MEMTEST_END			0x23e00000
++
++#ifdef CFG_USE_DATAFLASH_CS0
++
++/* bootstrap + u-boot + env + linux in dataflash on CS0 */
++#define CFG_ENV_IS_IN_DATAFLASH	1
++#define CFG_MONITOR_BASE	(CFG_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
++#define CFG_ENV_OFFSET		0x4200
++#define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS0 + CFG_ENV_OFFSET)
++#define CFG_ENV_SIZE		0x4200
++#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
++#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
++				"root=/dev/mtdblock0 "			\
++				"mtdparts=at91_nand:-(root) "		\
++				"rw rootfstype=jffs2"
++
++#elif CFG_USE_DATAFLASH_CS1
++
++/* bootstrap + u-boot + env + linux in dataflash on CS1 */
++#define CFG_ENV_IS_IN_DATAFLASH	1
++#define CFG_MONITOR_BASE	(CFG_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
++#define CFG_ENV_OFFSET		0x4200
++#define CFG_ENV_ADDR		(CFG_DATAFLASH_LOGIC_ADDR_CS1 + CFG_ENV_OFFSET)
++#define CFG_ENV_SIZE		0x4200
++#define CONFIG_BOOTCOMMAND	"cp.b 0xD0042000 0x22000000 0x210000; bootm"
++#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
++				"root=/dev/mtdblock0 "			\
++				"mtdparts=at91_nand:-(root) "		\
++				"rw rootfstype=jffs2"
++
++#else /* CFG_USE_NANDFLASH */
++
++/* bootstrap + u-boot + env + linux in nandflash */
++#define CFG_ENV_IS_IN_NAND	1
++#define CFG_ENV_OFFSET		0x60000
++#define CFG_ENV_OFFSET_REDUND	0x80000
++#define CFG_ENV_SIZE		0x20000		/* 1 sector = 128 kB */
++#define CONFIG_BOOTCOMMAND	"nand read 0x22000000 0xA0000 0x200000; bootm"
++#define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
++				"root=/dev/mtdblock5 "			\
++				"mtdparts=at91_nand:128k(bootstrap)ro,"	\
++				"256k(uboot)ro,128k(env1)ro,"		\
++				"128k(env2)ro,2M(linux),-(root) "	\
++				"rw rootfstype=jffs2"
++
++#endif
++
++#define CONFIG_BAUDRATE		115200
++#define CFG_BAUDRATE_TABLE	{115200 , 19200, 38400, 57600, 9600 }
++
++#define CFG_PROMPT		"U-Boot> "
++#define CFG_CBSIZE		256
++#define CFG_MAXARGS		16
++#define CFG_PBSIZE		(CFG_CBSIZE + sizeof(CFG_PROMPT) + 16)
++#define CFG_LONGHELP		1
++#define CONFIG_CMDLINE_EDITING	1
++
++#define ROUND(A, B)		(((A) + (B)) & ~((B) - 1))
++/*
++ * Size of malloc() pool
++ */
++#define CFG_MALLOC_LEN		ROUND(3 * CFG_ENV_SIZE + 128*1024, 0x1000)
++#define CFG_GBL_DATA_SIZE	128	/* 128 bytes for initial data */
++
++#define CONFIG_STACKSIZE	(32*1024)	/* regular stack */
++
++#ifdef CONFIG_USE_IRQ
++#error CONFIG_USE_IRQ not supported
++#endif
++
++#endif
+Index: board/atmel/at91sam9g20ek/nand.c
+===================================================================
+--- a/board/atmel/at91sam9g20ek/nand.c	(.../u-boot-1.3.4)	(revision 0)
++++ b/board/atmel/at91sam9g20ek/nand.c	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1,79 @@
++/*
++ * (C) Copyright 2007-2008
++ * Stelian Pop <stelian.pop@leadtechdesign.com>
++ * Lead Tech Design <www.leadtechdesign.com>
++ *
++ * (C) Copyright 2006 ATMEL Rousset, Lacressonniere Nicolas
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <common.h>
++#include <asm/arch/at91sam9260.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/at91_pio.h>
++
++#include <nand.h>
++
++/*
++ *	hardware specific access to control-lines
++ */
++#define	MASK_ALE	(1 << 21)	/* our ALE is AD21 */
++#define	MASK_CLE	(1 << 22)	/* our CLE is AD22 */
++
++static void at91sam9g20ek_nand_hwcontrol(struct mtd_info *mtd, int cmd)
++{
++	struct nand_chip *this = mtd->priv;
++	ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
++
++	IO_ADDR_W &= ~(MASK_ALE|MASK_CLE);
++	switch (cmd) {
++	case NAND_CTL_SETCLE:
++		IO_ADDR_W |= MASK_CLE;
++		break;
++	case NAND_CTL_SETALE:
++		IO_ADDR_W |= MASK_ALE;
++		break;
++	case NAND_CTL_CLRNCE:
++		at91_set_gpio_value(AT91_PIN_PC14, 1);
++		break;
++	case NAND_CTL_SETNCE:
++		at91_set_gpio_value(AT91_PIN_PC14, 0);
++		break;
++	}
++	this->IO_ADDR_W = (void *) IO_ADDR_W;
++}
++
++static int at91sam9g20ek_nand_ready(struct mtd_info *mtd)
++{
++	return at91_get_gpio_value(AT91_PIN_PC13);
++}
++
++int board_nand_init(struct nand_chip *nand)
++{
++	nand->eccmode = NAND_ECC_SOFT;
++#ifdef CFG_NAND_DBW_16
++	nand->options = NAND_BUSWIDTH_16;
++#endif
++	nand->hwcontrol = at91sam9g20ek_nand_hwcontrol;
++	nand->dev_ready = at91sam9g20ek_nand_ready;
++	nand->chip_delay = 20;
++
++	return 0;
++}
+Index: board/atmel/at91sam9g20ek/at91sam9g20ek.c
+===================================================================
+--- a/board/atmel/at91sam9g20ek/at91sam9g20ek.c	(.../u-boot-1.3.4)	(revision 0)
++++ b/board/atmel/at91sam9g20ek/at91sam9g20ek.c	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1,250 @@
++/*
++ * (C) Copyright 2007-2008
++ * Stelian Pop <stelian.pop@leadtechdesign.com>
++ * Lead Tech Design <www.leadtechdesign.com>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <common.h>
++#include <asm/arch/at91sam9260.h>
++#include <asm/arch/at91sam9260_matrix.h>
++#include <asm/arch/at91sam9_smc.h>
++#include <asm/arch/at91_pmc.h>
++#include <asm/arch/at91_rstc.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/io.h>
++#if defined(CONFIG_RESET_PHY_R) && defined(CONFIG_MACB)
++#include <net.h>
++#endif
++
++DECLARE_GLOBAL_DATA_PTR;
++
++/* ------------------------------------------------------------------------- */
++/*
++ * Miscelaneous platform dependent initialisations
++ */
++
++static void at91sam9g20ek_serial_hw_init(void)
++{
++#ifdef CONFIG_USART0
++	at91_set_A_periph(AT91_PIN_PB4, 1);		/* TXD0 */
++	at91_set_A_periph(AT91_PIN_PB5, 0);		/* RXD0 */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US0);
++#endif
++
++#ifdef CONFIG_USART1
++	at91_set_A_periph(AT91_PIN_PB6, 1);		/* TXD1 */
++	at91_set_A_periph(AT91_PIN_PB7, 0);		/* RXD1 */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US1);
++#endif
++
++#ifdef CONFIG_USART2
++	at91_set_A_periph(AT91_PIN_PB8, 1);		/* TXD2 */
++	at91_set_A_periph(AT91_PIN_PB9, 0);		/* RXD2 */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_US2);
++#endif
++
++#ifdef CONFIG_USART3	/* DBGU */
++	at91_set_A_periph(AT91_PIN_PB14, 0);		/* DRXD */
++	at91_set_A_periph(AT91_PIN_PB15, 1);		/* DTXD */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91_ID_SYS);
++#endif
++}
++
++#ifdef CONFIG_CMD_NAND
++static void at91sam9g20ek_nand_hw_init(void)
++{
++	unsigned long csa;
++
++	/* Enable CS3 */
++	csa = at91_sys_read(AT91_MATRIX_EBICSA);
++	at91_sys_write(AT91_MATRIX_EBICSA,
++		       csa | AT91_MATRIX_CS3A_SMC_SMARTMEDIA);
++
++	/* Configure SMC CS3 for NAND/SmartMedia */
++	at91_sys_write(AT91_SMC_SETUP(3),
++		       AT91_SMC_NWESETUP_(2) | AT91_SMC_NCS_WRSETUP_(0) |
++		       AT91_SMC_NRDSETUP_(2) | AT91_SMC_NCS_RDSETUP_(0));
++	at91_sys_write(AT91_SMC_PULSE(3),
++		       AT91_SMC_NWEPULSE_(4) | AT91_SMC_NCS_WRPULSE_(3) |
++		       AT91_SMC_NRDPULSE_(4) | AT91_SMC_NCS_RDPULSE_(3));
++	at91_sys_write(AT91_SMC_CYCLE(3),
++		       AT91_SMC_NWECYCLE_(7) | AT91_SMC_NRDCYCLE_(7));
++	at91_sys_write(AT91_SMC_MODE(3),
++		       AT91_SMC_READMODE | AT91_SMC_WRITEMODE |
++		       AT91_SMC_EXNWMODE_DISABLE |
++#ifdef CFG_NAND_DBW_16
++		       AT91_SMC_DBW_16 |
++#else /* CFG_NAND_DBW_8 */
++		       AT91_SMC_DBW_8 |
++#endif
++		       AT91_SMC_TDF_(3));
++
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOC);
++
++	/* Configure RDY/BSY */
++	at91_set_gpio_input(AT91_PIN_PC13, 1);
++
++	/* Enable NandFlash */
++	at91_set_gpio_output(AT91_PIN_PC14, 1);
++}
++#endif
++
++#ifdef CONFIG_HAS_DATAFLASH
++static void at91sam9g20ek_spi_hw_init(void)
++{
++	at91_set_A_periph(AT91_PIN_PA3, 0);	/* SPI0_NPCS0 */
++	at91_set_B_periph(AT91_PIN_PC11, 0);	/* SPI0_NPCS1 */
++
++	at91_set_A_periph(AT91_PIN_PA0, 0);	/* SPI0_MISO */
++	at91_set_A_periph(AT91_PIN_PA1, 0);	/* SPI0_MOSI */
++	at91_set_A_periph(AT91_PIN_PA2, 0);	/* SPI0_SPCK */
++
++	/* Enable clock */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_SPI0);
++}
++#endif
++
++#ifdef CONFIG_MACB
++static void at91sam9g20ek_macb_hw_init(void)
++{
++	/* Enable clock */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_EMAC);
++
++	/*
++	 * Disable pull-up on:
++	 *	RXDV (PA17) => PHY normal mode (not Test mode)
++	 *	ERX0 (PA14) => PHY ADDR0
++	 *	ERX1 (PA15) => PHY ADDR1
++	 *	ERX2 (PA25) => PHY ADDR2
++	 *	ERX3 (PA26) => PHY ADDR3
++	 *	ECRS (PA28) => PHY ADDR4  => PHYADDR = 0x0
++	 *
++	 * PHY has internal pull-down
++	 */
++	writel(pin_to_mask(AT91_PIN_PA14) |
++	       pin_to_mask(AT91_PIN_PA15) |
++	       pin_to_mask(AT91_PIN_PA17) |
++	       pin_to_mask(AT91_PIN_PA25) |
++	       pin_to_mask(AT91_PIN_PA26) |
++	       pin_to_mask(AT91_PIN_PA28),
++	       pin_to_controller(AT91_PIN_PA0) + PIO_PUDR);
++
++	/* Need to reset PHY -> 500ms reset */
++	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
++				     (AT91_RSTC_ERSTL & (0x0D << 8)) |
++				     AT91_RSTC_URSTEN);
++
++	at91_sys_write(AT91_RSTC_CR, AT91_RSTC_KEY | AT91_RSTC_EXTRST);
++
++	/* Wait for end hardware reset */
++	while (!(at91_sys_read(AT91_RSTC_SR) & AT91_RSTC_NRSTL));
++
++	/* Restore NRST value */
++	at91_sys_write(AT91_RSTC_MR, AT91_RSTC_KEY |
++				     (AT91_RSTC_ERSTL & (0x0 << 8)) |
++				     AT91_RSTC_URSTEN);
++
++	/* Re-enable pull-up */
++	writel(pin_to_mask(AT91_PIN_PA14) |
++	       pin_to_mask(AT91_PIN_PA15) |
++	       pin_to_mask(AT91_PIN_PA17) |
++	       pin_to_mask(AT91_PIN_PA25) |
++	       pin_to_mask(AT91_PIN_PA26) |
++	       pin_to_mask(AT91_PIN_PA28),
++	       pin_to_controller(AT91_PIN_PA0) + PIO_PUER);
++
++	at91_set_A_periph(AT91_PIN_PA19, 0);	/* ETXCK_EREFCK */
++	at91_set_A_periph(AT91_PIN_PA17, 0);	/* ERXDV */
++	at91_set_A_periph(AT91_PIN_PA14, 0);	/* ERX0 */
++	at91_set_A_periph(AT91_PIN_PA15, 0);	/* ERX1 */
++	at91_set_A_periph(AT91_PIN_PA18, 0);	/* ERXER */
++	at91_set_A_periph(AT91_PIN_PA16, 0);	/* ETXEN */
++	at91_set_A_periph(AT91_PIN_PA12, 0);	/* ETX0 */
++	at91_set_A_periph(AT91_PIN_PA13, 0);	/* ETX1 */
++	at91_set_A_periph(AT91_PIN_PA21, 0);	/* EMDIO */
++	at91_set_A_periph(AT91_PIN_PA20, 0);	/* EMDC */
++
++#ifndef CONFIG_RMII
++	at91_set_B_periph(AT91_PIN_PA28, 0);	/* ECRS */
++	at91_set_B_periph(AT91_PIN_PA29, 0);	/* ECOL */
++	at91_set_B_periph(AT91_PIN_PA25, 0);	/* ERX2 */
++	at91_set_B_periph(AT91_PIN_PA26, 0);	/* ERX3 */
++	at91_set_B_periph(AT91_PIN_PA27, 0);	/* ERXCK */
++#if defined(CONFIG_AT91SAM9G20EK)
++	/*
++	 * use PA10, PA11 for ETX2, ETX3.
++	 * PA23 and PA24 are for TWI EEPROM
++	 */
++	at91_set_B_periph(AT91_PIN_PA10, 0);    /* ETX2 */
++	at91_set_B_periph(AT91_PIN_PA11, 0);    /* ETX3 */
++#else
++	at91_set_B_periph(AT91_PIN_PA23, 0);    /* ETX2 */
++	at91_set_B_periph(AT91_PIN_PA24, 0);    /* ETX3 */
++#endif
++	at91_set_B_periph(AT91_PIN_PA22, 0);	/* ETXER */
++#endif
++
++}
++#endif
++
++int board_init(void)
++{
++	/* Enable Ctrlc */
++	console_init_f();
++
++	/* arch number of AT91SAM9G20EK-Board */
++	gd->bd->bi_arch_number = MACH_TYPE_AT91SAM9G20EK;
++	/* adress of boot parameters */
++	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
++
++	at91sam9g20ek_serial_hw_init();
++#ifdef CONFIG_CMD_NAND
++	at91sam9g20ek_nand_hw_init();
++#endif
++#ifdef CONFIG_HAS_DATAFLASH
++	at91sam9g20ek_spi_hw_init();
++#endif
++#ifdef CONFIG_MACB
++	at91sam9g20ek_macb_hw_init();
++#endif
++
++	return 0;
++}
++
++int dram_init(void)
++{
++	gd->bd->bi_dram[0].start = PHYS_SDRAM;
++	gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
++	return 0;
++}
++
++#ifdef CONFIG_RESET_PHY_R
++void reset_phy(void)
++{
++#ifdef CONFIG_MACB
++	/*
++	 * Initialize ethernet HW addr prior to starting Linux,
++	 * needed for nfsroot
++	 */
++	eth_init(gd->bd);
++#endif
++}
++#endif
+Index: board/atmel/at91sam9g20ek/led.c
+===================================================================
+--- a/board/atmel/at91sam9g20ek/led.c	(.../u-boot-1.3.4)	(revision 0)
++++ b/board/atmel/at91sam9g20ek/led.c	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1,64 @@
++/*
++ * (C) Copyright 2007-2008
++ * Stelian Pop <stelian.pop@leadtechdesign.com>
++ * Lead Tech Design <www.leadtechdesign.com>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++#include <common.h>
++#include <asm/arch/at91sam9260.h>
++#include <asm/arch/at91_pmc.h>
++#include <asm/arch/gpio.h>
++#include <asm/arch/io.h>
++
++#define	RED_LED		AT91_PIN_PA9	/* this is the power led */
++#define	GREEN_LED	AT91_PIN_PA6	/* this is the user led */
++
++void red_LED_on(void)
++{
++	at91_set_gpio_value(RED_LED, 1);
++}
++
++void red_LED_off(void)
++{
++	at91_set_gpio_value(RED_LED, 0);
++}
++
++void green_LED_on(void)
++{
++	at91_set_gpio_value(GREEN_LED, 0);
++}
++
++void green_LED_off(void)
++{
++	at91_set_gpio_value(GREEN_LED, 1);
++}
++
++void coloured_LED_init(void)
++{
++	/* Enable clock */
++	at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9260_ID_PIOA);
++
++	at91_set_gpio_output(RED_LED, 1);
++	at91_set_gpio_output(GREEN_LED, 1);
++
++	at91_set_gpio_value(RED_LED, 0);
++	at91_set_gpio_value(GREEN_LED, 1);
++}
+Index: board/atmel/at91sam9g20ek/partition.c
+===================================================================
+--- a/board/atmel/at91sam9g20ek/partition.c	(.../u-boot-1.3.4)	(revision 0)
++++ b/board/atmel/at91sam9g20ek/partition.c	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1,40 @@
++/*
++ * (C) Copyright 2008
++ * Ulf Samuelsson <ulf@atmel.com>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ */
++#include <common.h>
++#include <config.h>
++#include <asm/hardware.h>
++#include <dataflash.h>
++
++AT91S_DATAFLASH_INFO dataflash_info[CFG_MAX_DATAFLASH_BANKS];
++
++struct dataflash_addr cs[CFG_MAX_DATAFLASH_BANKS] = {
++	{CFG_DATAFLASH_LOGIC_ADDR_CS0, 0},	/* Logical adress, CS */
++	{CFG_DATAFLASH_LOGIC_ADDR_CS1, 1}
++};
++
++/*define the area offsets*/
++dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
++	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
++	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
++	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
++	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
++	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
++};
+Index: board/atmel/at91sam9g20ek/config.mk
+===================================================================
+--- a/board/atmel/at91sam9g20ek/config.mk	(.../u-boot-1.3.4)	(revision 0)
++++ b/board/atmel/at91sam9g20ek/config.mk	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1 @@
++TEXT_BASE = 0x23f00000
+Index: board/atmel/at91sam9g20ek/Makefile
+===================================================================
+--- a/board/atmel/at91sam9g20ek/Makefile	(.../u-boot-1.3.4)	(revision 0)
++++ b/board/atmel/at91sam9g20ek/Makefile	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -0,0 +1,57 @@
++#
++# (C) Copyright 2003-2008
++# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
++#
++# (C) Copyright 2008
++# Stelian Pop <stelian.pop@leadtechdesign.com>
++# Lead Tech Design <www.leadtechdesign.com>
++#
++# See file CREDITS for list of people who contributed to this
++# project.
++#
++# This program is free software; you can redistribute it and/or
++# modify it under the terms of the GNU General Public License as
++# published by the Free Software Foundation; either version 2 of
++# the License, or (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++# MA 02111-1307 USA
++#
++
++include $(TOPDIR)/config.mk
++
++LIB	= $(obj)lib$(BOARD).a
++
++COBJS-y	+= at91sam9g20ek.o
++COBJS-y	+= led.o
++COBJS-y	+= partition.o
++COBJS-$(CONFIG_CMD_NAND) += nand.o
++
++SRCS	:= $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
++OBJS	:= $(addprefix $(obj),$(COBJS-y))
++SOBJS	:= $(addprefix $(obj),$(SOBJS))
++
++$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
++	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
++
++clean:
++	rm -f $(SOBJS) $(OBJS)
++
++distclean:	clean
++	rm -f $(LIB) core *.bak $(obj).depend
++
++#########################################################################
++
++# defines $(obj).depend target
++include $(SRCTREE)/rules.mk
++
++sinclude $(obj).depend
++
++#########################################################################
+Index: include/asm-arm/arch-at91/hardware.h
+===================================================================
+--- a/include/asm-arm/arch-at91/hardware.h	(.../u-boot-1.3.4)	(revision 8417)
++++ b/include/asm-arm/arch-at91/hardware.h	(.../u-boot-1.3.4-exp)	(revision 8417)
+@@ -18,7 +18,7 @@
+ 
+ #if defined(CONFIG_AT91RM9200)
+ #include <asm/arch/at91rm9200.h>
+-#elif defined(CONFIG_AT91SAM9260)
++#elif defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9G20)
+ #include <asm/arch/at91sam9260.h>
+ #define AT91_BASE_EMAC	AT91SAM9260_BASE_EMAC
+ #define AT91_BASE_SPI	AT91SAM9260_BASE_SPI0
+diff -urN u-boot-2008.10-0rig/include/asm-arm/mach-types.h u-boot-2008.10/include/asm-arm/mach-types.h
+--- u-boot-2008.10-0rig/include/asm-arm/mach-types.h	2008-10-18 21:30:31.000000000 +0200
++++ u-boot-2008.10/include/asm-arm/mach-types.h	2008-12-28 23:40:55.000000000 +0100
+@@ -23998,6 +23998,18 @@
+ # define machine_is_geneva()	(0)
+ #endif
+ 
++#ifdef CONFIG_MACH_AT91SAM9G20EK
++# ifdef machine_arch_type
++#  undef machine_arch_type
++#  define machine_arch_type __machine_arch_type
++# else
++#  define machine_arch_type MACH_TYPE_AT91SAM9G20EK
++# endif
++# define machine_is_at91sam9g20ek() (machine_arch_type == MACH_TYPE_AT91SAM9G20EK)
++#else
++# define machine_is_at91sam9g20ek() (0)
++#endif
++
+ /*
+  * These have not yet been registered
+  */
+diff -urN u-boot-2008.10-0rig/board/atmel/at91sam9g20ek/at91sam9g20ek.c u-boot-2008.10/board/atmel/at91sam9g20ek/at91sam9g20ek.c
+--- u-boot-2008.10-0rig/board/atmel/at91sam9g20ek/at91sam9g20ek.c	2008-12-28 14:09:52.000000000 +0100
++++ u-boot-2008.10/board/atmel/at91sam9g20ek/at91sam9g20ek.c	2008-12-28 23:56:09.000000000 +0100
+@@ -248,3 +248,13 @@
+ #endif
+ }
+ #endif
++
++int board_eth_init(bd_t *bis)
++{
++	int rc = 0;
++#ifdef CONFIG_MACB
++	rc = macb_eth_initialize(0, (void *)AT91_BASE_EMAC, 0x00);
++#endif
++	return rc;
++}
++

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-03  0:05 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-03  0:05 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-03 00:05:42 +0000 (Sat, 03 Jan 2009)
New Revision: 24657

Log:
Add facilities for installing u-boot in different locations

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-008-Makefile.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-008-Makefile.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-008-Makefile.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-008-Makefile.patch	2009-01-03 00:05:42 UTC (rev 24657)
@@ -0,0 +1,64 @@
+diff -urN u-boot-2008.10-0rig//Makefile u-boot-2008.10/Makefile
+--- u-boot-2008.10-0rig//Makefile	2008-12-31 18:11:18.000000000 +0100
++++ u-boot-2008.10/Makefile	2008-12-31 18:39:58.000000000 +0100
+@@ -20,6 +20,7 @@
+ # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ # MA 02111-1307 USA
+ #
++BUILD_DATE= $(shell date +%F)
+ 
+ VERSION = 2008
+ PATCHLEVEL = 10
+@@ -294,6 +295,22 @@
+ ALL += $(obj)u-boot.ldr
+ endif
+ 
++ifneq ($(BOARDNAME),)
++BINARY := $(BOARDNAME)-u-boot-$(U_BOOT_VERSION)-$(BUILD_DATE)
++BINARY_BIN := $(obj)$(BINARY).bin
++BINARY_GZ  := $(obj)$(BINARY).gz
++ALL += $(BINARY_BIN)
++ALL += $(BINARY_GZ)
++else
++BINARY := u-boot
++BINARY_BIN := $(obj)$(BINARY).bin
++BINARY_GZ  := $(obj)$(BINARY).gz
++endif
++
++ifeq ($(DESTDIR),)
++DESTDIR=binaries
++endif
++
+ all:		$(ALL)
+ 
+ $(obj)u-boot.hex:	$(obj)u-boot
+@@ -302,9 +319,20 @@
+ $(obj)u-boot.srec:	$(obj)u-boot
+ 		$(OBJCOPY) -O srec $< $@
+ 
+-$(obj)u-boot.bin:	$(obj)u-boot
++$(BINARY_BIN):	$(obj)u-boot
+ 		$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+ 
++$(BINARY_GZ):	$(BINARY_BIN)
++		gzip -c $(BINARY_BIN) > $(BINARY_GZ)
++
++install:	all
++		-install -d	$(DESTDIR)
++		install		$(BINARY_BIN)	$(DESTDIR)
++
++tftp:		install
++		cp $(BINARY_GZ)				$(TFTPBOOT)/$(BINARY).gz
++		cp $(BINARY_BIN) 			$(TFTPBOOT)/$(BINARY).bin
++
+ $(obj)u-boot.ldr:	$(obj)u-boot
+ 		$(LDR) -T $(CONFIG_BFIN_CPU) -f -c $@ $< $(LDR_FLAGS)
+ 
+@@ -3295,6 +3324,7 @@
+ 		-o -name '*.srec' -o -name '*.bin' -o -name u-boot.img \) \
+ 		-print0 \
+ 		| xargs -0 rm -f
++	@rm -f $(obj)u-boot-*.gz
+ 	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
+ 		$(obj)cscope.* $(obj)*.*~
+ 	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-03  0:04 ulf at uclibc.org
  2009-01-06 14:39 ` Peter Korsgaard
  0 siblings, 1 reply; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-03  0:04 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-03 00:04:55 +0000 (Sat, 03 Jan 2009)
New Revision: 24656

Log:
Provide factory default command to u-boot, using Buildroot variables

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-009-factory.patch	2009-01-03 00:04:55 UTC (rev 24656)
@@ -0,0 +1,323 @@
+diff -urN u-boot-2009.01-0rig//common/cmd_factory.c u-boot-2009.01/common/cmd_factory.c
+--- u-boot-2009.01-0rig//common/cmd_factory.c	1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2009.01/common/cmd_factory.c	2009-01-02 19:32:07.000000000 +0100
+@@ -0,0 +1,308 @@
++/*
++ * (C) Copyright 2000
++ * Ulf Samuelsson	<ulf.samuelsson@atmelcom>.
++ *
++ * 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
++ */
++
++/*
++ * Boot support
++ */
++#include <config.h>
++#include <common.h>
++#include <command.h>
++#include <dataflash.h>
++
++/* 
++ * 
++ * The typical use of this file, is to update config.h
++ * from an external build system
++ * 
++ */
++
++
++/*
++ * Macros to transform values
++ * into environment strings.
++ */
++#define XMK_STR(x)		#x
++#define MK_STR(x)		XMK_STR(x)
++
++void		setargs(void);
++
++int do_factory_defaults (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++#if	defined(CONFIG_ETHADDR)
++	setenv("ethaddr",	MK_STR(CONFIG_ETHADDR));
++#endif
++#if	defined(CONFIG_ETH1ADDR)
++	setenv("eth1addr",	MK_STR(CONFIG_ETH1ADDR));
++#endif
++#if	defined(CONFIG_HOSTNAME)
++	setenv("hostname",	MK_STR(CONFIG_HOSTNAME));
++#endif
++#if	defined(CONFIG_IPADDR)
++	setenv("ipaddr",	MK_STR(CONFIG_IPADDR));
++#endif
++#if	defined(CONFIG_SERVERIP)
++	setenv("serverip",	MK_STR(CONFIG_SERVERIP));
++#endif
++#if	defined(CONFIG_GATEWAY)
++	setenv("gatewayip",	MK_STR(CONFIG_GATEWAY));
++#endif
++#if	defined(CONFIG_NETMASK)
++	setenv("netmask",	MK_STR(CONFIG_NETMASK));
++#endif
++#if	defined(KERNEL_START)
++	setenv("kernel",	MK_STR(KERNEL_START));
++#endif
++#if	defined(KERNEL_LOCATION)
++	setenv("OS",		MK_STR(KERNEL_LOCATION));
++#endif
++#if	defined(FILESYSTEM_START)
++	setenv("ramdisk",	MK_STR(FILESYSTEM_START));
++	setenv("initrd",	MK_STR(FILESYSTEM_START)","MK_STR(FILESYSTEM_SIZE));
++#endif
++#if	defined(FILESYSTEM_LOCATION)
++	setenv("FS",		MK_STR(FS_LOCATION));
++#endif
++#if	defined(END_OF_FLASH)
++	setenv("endflash",	MK_STR(END_OF_FLASH));
++#endif
++#if	defined(CONFIG_LOAD_SCRIPTS)
++	/* By updating the "fs-date" environment variable and running "fs"
++	   You set "rd-1" and "rd-2"
++	*/ 
++	setenv("rd-1",		"rootfs.arm-"MK_STR(DATE)".ext2");
++	setenv("rd-2",		"rootfs.arm-"MK_STR(DATE)".jffs2");
++	setenv("rd-3",		"rootfs.arm-linux.ext2");
++	setenv("rd-4",		"rootfs.arm-linux.jffs2");
++	setenv("ver",		"1");
++
++	setenv("config",	"tftp  ${ramdisk} autoscript.${hostname} ; autoscr ${ramdisk} ");
++
++#if	defined(KERNEL_VERSION)
++	setenv("kernel-version",MK_STR(KERNEL_VERSION));
++#endif
++#if	defined(DATE)
++	setenv("kernel-date",	MK_STR(DATE));
++	setenv("fs-date",	MK_STR(DATE));
++	setenv("rd",		"rootfs.arm-"MK_STR(DATE)".ext2");
++#endif
++#if	defined(KERNEL_VERSION)
++	setenv("linux",		MK_STR(BOARD_NAME)"-linux-"MK_STR(KERNEL_VERSION)"-"MK_STR(DATE)".gz");
++#endif
++	setenv("get-ramdisk",	"tftp	${ramdisk}	${rd};		setenv rd-size	${filesize}");
++	setenv("store-ramdisk",	"cp.b	${ramdisk}	${FS}		${rd-size}");
++	setenv("load-ramdisk",	"cp.b	${FS}		${ramdisk}	${rd-size}");
++	setenv("flash-ramdisk",	"run	get-ramdisk;	run		store-ramdisk");
++
++	setenv("get-kernel",	"tftp	${kernel}	${linux};	setenv	kernel-size	${filesize}");
++	setenv("store-kernel",	"cp.b	${kernel}	${OS}		${kernel-size};		saveenv");
++	setenv("load-kernel",	"cp.b	${OS}		${kernel}	${kernel-size};		saveenv");
++	setenv("flash-kernel",	"run	get-kernel;	run		store-kernel");
++
++	setenv("get",		"run get-kernel		; run get-ramdisk");
++	setenv("flash",		"run flash-kernel	; run flash-ramdisk ; saveenv");
++	setenv("load",		"run load-kernel	; run load-ramdisk");
++
++	setenv("bootcmd",	"run load ; bootm "MK_STR(KERNEL_START));
++
++	setenv("fstype",	"ram");
++	setenv("flashfs",	"/dev/mtdblock2");
++	setenv("ramfs",		"/dev/ram");
++
++	setenv("rootfstype",	"jffs2");
++	setenv("access",	"rw");
++	setenv("ramdisk_size",	"15360");
++	setenv("console",	"ttyS0,115200");
++
++
++#if	defined(MEMORY_SIZE)
++	setenv("mem",		MK_STR(MEMORY_SIZE));
++#else
++	setenv("mem",		"32M");	/* Cautious default */
++#endif
++
++	setenv("update",	"os; fs; setargs");
++	setenv("cmpk",		"run flash-kernel; cp.b ${OS} ${ramdisk} ${kernel-size}; cmp ${kernel} ${ramdisk} ${kernel-size}"); 
++#endif	/* CONFIG_LOAD_SCRIPTS */
++#if	defined(CONFIG_AT91RM9200)
++	setenv("machid24",	"0x0fb");
++	setenv("machid26",	"0x2c1");
++	setenv("machid",	"0x2c1");
++	setenv("k24",		"setenv machid ${machid24}; os");
++	setenv("k26",		"setenv machid ${machid26}; os");
++#endif
++	AT91F_DataflashSetEnv ();
++#if	defined(CONFIG_LOAD_SCRIPTS)
++	setargs();
++#endif
++	return (saveenv() ? 1 : 0);
++}
++
++
++
++U_BOOT_CMD(
++	factory,	1,	1,	do_factory_defaults,
++	"factory\t- Create a default environment\n",
++	"\n"
++);
++
++#if	defined(CONFIG_LOAD_SCRIPTS)
++void		setargs(void)
++{
++	char cmd[512];
++	char fstype[512];
++
++	sprintf(fstype,getenv("fstype"));
++	if((fstype[0] != 'f') && (fstype[0] != 'r')) {
++		fstype[0] = 'r';
++	}
++
++	if(fstype[0] == 'f') {
++		sprintf(cmd,"root=%s rootfstype=%s ip=%s:%s:%s:%s console=%s,mem=%s",
++			getenv("flashfs"),
++			getenv("rootfstype"),
++			getenv("ipaddr"),
++			getenv("serverip"),
++			getenv("gatewayip"),
++			getenv("netmask"),
++			getenv("console"),
++			getenv("mem")
++		);
++		cmd[511] = '\0';
++		printf("len=%d: %s\n",strlen(cmd),cmd);
++		if(strlen(cmd) > 500) {
++			printf("Error: Environment too large during 'setargs'\n");
++		} else {
++			setenv("bootargs",cmd);
++			setenv("bootcmd",	"run load-kernel ; bootm 21000000");
++		}
++	} else if(fstype[0] == 'r') {
++		sprintf(cmd,"root=%s %s initrd=%s ramdisk_size=%s ip=%s:%s:%s:%s console=%s,mem=%s",
++			getenv("ramfs"),
++			getenv("access"),
++			getenv("initrd"),
++			getenv("ramdisk_size"),
++			getenv("ipaddr"),
++			getenv("serverip"),
++			getenv("gatewayip"),
++			getenv("netmask"),
++			getenv("console"),
++			getenv("mem")
++		);
++		printf("len=%d: %s\n",strlen(cmd),cmd);
++		cmd[511] = '\0';
++		if(strlen(cmd) > 500) {
++			printf("Error: Environment too large during 'setargs'\n");
++		} else {
++			setenv("bootargs",cmd);
++			setenv("bootcmd",	"run load ; bootm 21000000");
++		}
++	} else {
++		setenv("bootargs","no args");
++	}
++}
++
++int do_setargs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++	setargs();
++	return 0;
++}
++
++U_BOOT_CMD(
++	setargs,	1,	1,	do_setargs,
++	"setargs\t- Create a bootargs from:"
++	"fstype=flash:	(${flash} ${access} ${initrd} ${ramdisk_size}) "
++	"fstype=ram:	(${ram}   ${access} ${initrd} ${ramdisk_size}) "
++	"${ipaddr} ${serverip} ${gatewayip} ${netmask} "
++	"${console} ${mem}\n"
++	,	"\n"
++);
++
++int do_os (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++	char *kchip;
++	char *kdate;
++	char *kver;
++	char cmd[512];
++	kchip = getenv("hostname");
++	kdate = getenv("kernel-date");
++	kver = getenv("kernel-version");
++	if((strlen(kdate) + strlen(kver) + 32) >  500) {
++		printf("Error: Environment too large during 'os': ");
++		printf("len=%d\n", strlen(kdate) + strlen(kver) + 32);
++	} else if(kver != NULL) {
++		if(kdate != NULL) {
++			sprintf(cmd,"%s-linux-%s-%s.gz",kchip,kver,kdate);
++		} else {
++			sprintf(cmd,"%s-linux-%s.gz",kchip,kver);
++		}
++		printf("Setting kernel to %s\n",cmd);
++		setenv("linux",cmd);
++		return 0;
++	}
++	return 1;
++}
++
++U_BOOT_CMD(
++	os,	1,	1,	do_os,
++	"os\t- Select linux version  ${hostname}-linux-${kernel-name}-${kernel-date}\n"
++	,	"\n"
++);
++
++
++int do_fs (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
++{
++	char *ver;
++	char *fsdate;
++	char *hostname;
++	char cmd[512];
++	fsdate		= getenv("fs-date");
++	hostname	= getenv("hostname");
++
++	if(fsdate != NULL) {
++		sprintf(cmd,"rootfs.arm-%s.ext2",fsdate);
++		setenv("rd-1",cmd);
++		sprintf(cmd,"rootfs.arm-%s.jffs2",fsdate);
++		setenv("rd-2",cmd);
++	}
++	ver = getenv("ver");		/* Find out which version we are using*/
++	if(cmd==NULL) {
++		setenv("ver","1");
++	}
++	ver = getenv("ver");		/* Find out which version we are using*/
++	sprintf(cmd,"rd-%s",ver);	/* create rd${ver}*/
++	ver=getenv(cmd);
++	sprintf(cmd,"%s",ver);
++	printf("Setting ramdisk to %s\n",cmd);
++	setenv("rd",cmd);
++	return 0;
++}
++
++
++U_BOOT_CMD(
++	fs,	1,	1,	do_fs,
++	"fs\t- Select ramdisk version == rd-${ver}\n"
++	,	"\n"
++);
++#endif /* #if	defined(CONFIG_LOAD_SCRIPTS) */
++
++#endif	/* CONFIG_DEFENV */
+diff -urN u-boot-2009.01-0rig//common/Makefile u-boot-2009.01/common/Makefile
+--- u-boot-2009.01-0rig//common/Makefile	2008-12-16 23:48:27.000000000 +0100
++++ u-boot-2009.01/common/Makefile	2009-01-02 19:17:16.000000000 +0100
+@@ -84,6 +84,7 @@
+ COBJS-$(CONFIG_CMD_EEPROM) += cmd_eeprom.o
+ COBJS-$(CONFIG_CMD_ELF) += cmd_elf.o
+ COBJS-$(CONFIG_CMD_EXT2) += cmd_ext2.o
++COBJS-$(CONFIG_CMD_FACTORY) += cmd_factory.o
+ COBJS-$(CONFIG_CMD_FAT) += cmd_fat.o
+ COBJS-$(CONFIG_CMD_FDC)$(CONFIG_CMD_FDOS) += cmd_fdc.o
+ COBJS-$(CONFIG_OF_LIBFDT) += cmd_fdt.o fdt_support.o

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-03  0:04 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-03  0:04 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-03 00:04:14 +0000 (Sat, 03 Jan 2009)
New Revision: 24655

Log:
Fix issue with AT91/AVR32 Ethernet MACB

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-006-drivers-net-macb.c.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-006-drivers-net-macb.c.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-006-drivers-net-macb.c.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-006-drivers-net-macb.c.patch	2009-01-03 00:04:14 UTC (rev 24655)
@@ -0,0 +1,28 @@
+diff -urN u-boot-2008.10-0rig/drivers/net/macb.c u-boot-2008.10/drivers/net/macb.c
+--- u-boot-2008.10-0rig/drivers/net/macb.c	2008-10-18 21:30:31.000000000 +0200
++++ u-boot-2008.10/drivers/net/macb.c	2008-12-28 23:44:11.000000000 +0100
+@@ -415,18 +415,16 @@
+ 
+ 	/* choose RMII or MII mode. This depends on the board */
+ #ifdef CONFIG_RMII
+-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+-    defined(CONFIG_AT91SAM9263)
+-	macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
+-#else
++#if defined(CONFIG_AVR32)
+ 	macb_writel(macb, USRIO, 0);
+-#endif
+ #else
+-#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
+-    defined(CONFIG_AT91SAM9263)
+-	macb_writel(macb, USRIO, MACB_BIT(CLKEN));
++	macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
++#endif
+ #else
++#if defined(CONFIG_AVR32)
+ 	macb_writel(macb, USRIO, MACB_BIT(MII));
++#else
++	macb_writel(macb, USRIO, MACB_BIT(CLKEN));
+ #endif
+ #endif /* CONFIG_RMII */
+ 

^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1
@ 2009-01-03  0:03 ulf at uclibc.org
  0 siblings, 0 replies; 26+ messages in thread
From: ulf at uclibc.org @ 2009-01-03  0:03 UTC (permalink / raw)
  To: buildroot

Author: ulf
Date: 2009-01-03 00:03:31 +0000 (Sat, 03 Jan 2009)
New Revision: 24654

Log:
Add X-Modem tools for minicom to u-boot allowing easy downloading of U-Boot

Added:
   trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-007-tools.patch


Changeset:
Added: trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-007-tools.patch
===================================================================
--- trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-007-tools.patch	                        (rev 0)
+++ trunk/buildroot/target/u-boot/2009.01-rc1/u-boot-2009.01-rc1-007-tools.patch	2009-01-03 00:03:31 UTC (rev 24654)
@@ -0,0 +1,576 @@
+diff -urN u-boot-2008.10-0rig//tools/Makefile u-boot-2008.10/tools/Makefile
+--- u-boot-2008.10-0rig//tools/Makefile	2008-12-31 17:51:29.000000000 +0100
++++ u-boot-2008.10/tools/Makefile	2008-12-31 19:38:15.000000000 +0100
+@@ -37,6 +37,11 @@
+ #OBJ_FILES	+= mpc86x_clk.o
+ #endif
+ 
++ifeq ($(VENDOR),atmel)
++BINS+= raw-at91$(SFX) sx-at91$(SFX)
++OBJS+= raw-at91.o sx-at91.o
++endif
++
+ LIBFDT_OBJ_FILES	= $(obj)fdt.o $(obj)fdt_ro.o $(obj)fdt_rw.o $(obj)fdt_strerror.o $(obj)fdt_wip.o
+ 
+ LOGO_H	= $(OBJTREE)/include/bmp_logo.h
+@@ -175,6 +180,14 @@
+ 		$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
+ 		$(STRIP) $@
+ 
++$(obj)raw-at91$(SFX):	$(obj)raw-at91.o
++		$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
++		$(STRIP) $@
++
++$(obj)sx-at91$(SFX):	$(obj)sx-at91.o
++		$(CC) $(CFLAGS) $(HOST_LDFLAGS) -o $@ $^
++		$(STRIP) $@
++
+ $(obj)envcrc.o:	$(src)envcrc.c
+ 		$(CC) -g $(CFLAGS) -c -o $@ $<
+ 
+@@ -223,6 +236,12 @@
+ $(obj)fdt_wip.o:	$(obj)fdt_wip.c
+ 		$(CC) -g $(FIT_CFLAGS) -c -o $@ $<
+ 
++$(obj)sx-at91.o:		$(src)sx-at91.c
++		$(CC) -g $(CFLAGS) -c -o $@ $<
++
++$(obj)raw-at91.o:	$(src)raw-at91.c
++		$(CC) -g $(CFLAGS) -c -o $@ $<
++
+ subdirs:
+ ifeq ($(TOOLSUBDIRS),)
+ 		@:
+diff -urN u-boot-2008.10-0rig//tools/raw-at91.c u-boot-2008.10/tools/raw-at91.c
+--- u-boot-2008.10-0rig//tools/raw-at91.c	1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2008.10/tools/raw-at91.c	2008-12-31 19:26:23.000000000 +0100
+@@ -0,0 +1,225 @@
++/*
++ * xmodem-at91.c
++ *
++ * A simple program using xmodem/1kxmode upload file to at91rm9200 based board.
++ * Created by (C) Copyright 2004
++ * Linhang.Zhang, Jilin University of PR.China, linxing at jlu.edu.cn.
++ *
++ *************************************************************************************
++ *
++ * Modified 01-Feb-2005 (C)Copyright 2005
++ * Marco Cavallini, www.KoanSoftware.com - ITALY, m.cavallini@koansoftware.com
++ * - edited indentations and changed break usage in switch statement.
++ * - added "\r" to printf
++ *
++ * - build with 
++ *   gcc sx-at91.c -o sx-at91
++ *
++ * - Howto use this program with minicom/xminicom and AT91 
++ *   start minicom or xminicom
++ *   edit Options / File transfer protocol, 
++ *   add a name (for example J) like the following example
++ *
++ *   |     Name             Program                 Name U/D FullScr IO-Red. Multi  |
++ *   | A  zmodem     /usr/bin/sz -vv -b              Y    U    N       Y       Y    |
++ *   | B  ymodem     /usr/bin/sb -vv                 Y    U    N       Y       Y    |
++ *   | C  xmodem     /usr/bin/sx -vv                 Y    U    N       Y       N    |
++ *   | D  zmodem     /usr/bin/rz -vv -b -E           N    D    N       Y       Y    |
++ *   | E  ymodem     /usr/bin/rb -vv                 N    D    N       Y       Y    |
++ *   | F  xmodem     /usr/bin/rx -vv                 Y    D    N       Y       N    |
++ *   | G  kermit     /usr/bin/kermit -i -l %l -s     Y    U    Y       N       N    |
++ *   | H  kermit     /usr/bin/kermit -i -l %l -r     N    D    Y       N       N    |
++ *   | I  ascii      /usr/bin/ascii-xfr -dsv         Y    U    N       Y       N    |
++ *   | J  at91       /home/koan/xmodem/xs-at91       Y    U    Y       N       N    |
++ *   | K    -                                                                       |
++ *   | L    -                                                                       |
++ *
++ *   save and use it selecting at91 protocol when you start an Xmodem upload to AT91
++ *
++ *************************************************************************************
++ *
++ * 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     <stdio.h>
++#include     <stdlib.h>
++#include     <string.h>
++#include     <unistd.h>
++#include     <sys/types.h>
++#include     <sys/stat.h>
++#include     <fcntl.h>
++#include     <termios.h>
++#include     <errno.h>
++#include     <time.h>
++
++#define	TRUE		1
++#define	FALSE		0
++#define LINESIZE	1024
++
++/*********/
++
++#define SERIAL_DEVICE "/dev/ttyS0"
++#define MYBAUDRATE B115200
++
++/***************SUB PROGRAM*******/
++
++int Initial_SerialPort(void)
++{
++	int fd;
++	struct termios options;
++
++	fd = open( SERIAL_DEVICE , O_RDWR | O_NOCTTY | O_NDELAY );
++	if ( fd == -1 )
++	{ 
++		/*open error!*/
++		perror("Can't open serial port!");
++		return -1;
++	}
++
++	/*Get the current options for the port...*/
++	tcgetattr(fd, &options);
++
++	/*Set the baud rates to BAUDRATE...*/
++	cfsetispeed(&options,MYBAUDRATE);
++	cfsetospeed(&options,MYBAUDRATE);
++	tcsetattr(fd, TCSANOW, &options);
++	if (0 != tcgetattr(fd, &options)) 
++	{
++		perror("SetupSerial 1");
++		return -1;
++	} 
++	
++	/*
++	 * 8bit Data,no partity,1 stop bit...
++	 */
++	options.c_cflag &= ~PARENB;
++	options.c_cflag &= ~CSTOPB;
++	options.c_cflag &= ~CSIZE;
++	options.c_cflag |= CS8;
++	tcflush(fd,TCIFLUSH);
++
++	/***Choosing Raw Input*/
++	options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
++	options.c_oflag &= ~OPOST; 
++
++	/*
++	 * Set the new options for the port...
++	 */
++	if (0 != tcsetattr(fd, TCSANOW, &options))
++	{
++ 		perror("SetupSerial error");
++ 		return -1 ;
++	}
++
++	return fd ;
++}
++
++/******************************/
++void ClearReceiveBuffer(int fd)
++{
++	unsigned char tmp;
++	while ((read(fd,&tmp,1))>0);
++	
++	return;
++}
++unsigned char filebuf[ LINESIZE+2 ];
++unsigned char outbuf[ LINESIZE+2 ];
++FILE *datafile;
++int fd;
++
++static	unsigned int	ChCnt=0;
++static	unsigned int	ChIx;
++unsigned char	GetChar(unsigned char *ch)
++/* 
++ * SUCCESS:	Return TRUE
++ * FAILURE:	Return FALSE
++ */
++{
++  
++  if(ChCnt == 0) {
++    ChCnt = fread( filebuf, sizeof(char), LINESIZE, datafile);
++    ChIx = 0;
++  }
++  if(ChCnt > 0) {
++    *ch = filebuf[ChIx++];
++    ChCnt--;
++    return TRUE;
++  } else {
++    return FALSE;	/* Reached End of File */
++  }
++}
++
++/********************************/
++void	delay()
++{
++}
++
++int main(int argc,char *argv[])
++{
++	char *data_file_name;
++	int	len;
++	unsigned char c;
++	int complete,i,sts;
++
++	printf("raw-at91 started...\r\n");
++	
++	/* open serial port1 */
++	if ( (fd = Initial_SerialPort()) == -1)  
++		return -1 ;
++
++	data_file_name = argv[1];
++
++	if((datafile=fopen(data_file_name,"rb"))==NULL)
++	{
++		perror ("Can't open file!");
++		return -1 ;
++	}
++
++	/*******************************/
++	
++	complete = 0;
++	/*	ClearReceiveBuffer(fd); */
++
++	/* while((read(fd,&ack_id,1))<=0);*/
++	
++	/* printf("%c\r\n",ack_id); */
++	while(!complete)
++	{
++	  for(i=0;i < LINESIZE; i++) {		/* A line more than 1024 characters will have problems...*/
++	    if((sts = GetChar(&outbuf[i]))) {
++	      /* Sts = Success */
++	      if((c = outbuf[i]) == '\n') {	/* Found end of Line - Start Processing*/
++		outbuf[i+1] = '\0';		/* Terminate String*/
++		break;
++	      }
++	    } else {
++	      /* Sts = Failure - End of File */
++	      outbuf[i] = '\n';
++	      outbuf[i+1] = '\0';
++	      complete = 1;
++	    }
++	  }
++	  printf("%s",outbuf);		/* Inform user */
++	  len = strlen((char *)outbuf);
++	  write(fd,outbuf,strlen((char *)outbuf));
++	  for(i = 0; i < 500000000; i++ ) delay();
++	  while((read(fd,&c,1))<=0) putchar(c);
++	  printf("  ");
++	}
++	fclose(datafile);
++	close(fd);
++	return 0;
++}
+diff -urN u-boot-2008.10-0rig//tools/sx-at91.c u-boot-2008.10/tools/sx-at91.c
+--- u-boot-2008.10-0rig//tools/sx-at91.c	1970-01-01 01:00:00.000000000 +0100
++++ u-boot-2008.10/tools/sx-at91.c	2008-12-31 19:26:23.000000000 +0100
+@@ -0,0 +1,300 @@
++/*
++ * xmodem-at91.c
++ *
++ * A simple program using xmodem/1kxmode upload file to at91rm9200 based board.
++ * Created by (C) Copyright 2004
++ * Linhang.Zhang, Jilin University of PR.China, linxing at jlu.edu.cn.
++ *
++ *************************************************************************************
++ *
++ * Modified 01-Feb-2005 (C)Copyright 2005
++ * Marco Cavallini, www.KoanSoftware.com - ITALY, m.cavallini@koansoftware.com
++ * - edited indentations and changed break usage in switch statement.
++ * - added "\r" to printf
++ *
++ * - build with 
++ *   gcc sx-at91.c -o sx-at91
++ *
++ * - Howto use this program with minicom/xminicom and AT91 
++ *   start minicom or xminicom
++ *   edit Options / File transfer protocol, 
++ *   add a name (for example J) like the following example
++ *
++ *   |     Name             Program                 Name U/D FullScr IO-Red. Multi  |
++ *   | A  zmodem     /usr/bin/sz -vv -b              Y    U    N       Y       Y    |
++ *   | B  ymodem     /usr/bin/sb -vv                 Y    U    N       Y       Y    |
++ *   | C  xmodem     /usr/bin/sx -vv                 Y    U    N       Y       N    |
++ *   | D  zmodem     /usr/bin/rz -vv -b -E           N    D    N       Y       Y    |
++ *   | E  ymodem     /usr/bin/rb -vv                 N    D    N       Y       Y    |
++ *   | F  xmodem     /usr/bin/rx -vv                 Y    D    N       Y       N    |
++ *   | G  kermit     /usr/bin/kermit -i -l %l -s     Y    U    Y       N       N    |
++ *   | H  kermit     /usr/bin/kermit -i -l %l -r     N    D    Y       N       N    |
++ *   | I  ascii      /usr/bin/ascii-xfr -dsv         Y    U    N       Y       N    |
++ *   | J  at91       /home/koan/xmodem/xs-at91       Y    U    Y       N       N    |
++ *   | K    -                                                                       |
++ *   | L    -                                                                       |
++ *
++ *   save and use it selecting at91 protocol when you start an Xmodem upload to AT91
++ *
++ *************************************************************************************
++ *
++ * 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     <stdio.h>
++#include     <stdlib.h>
++#include     <unistd.h>
++#include     <sys/types.h>
++#include     <sys/stat.h>
++#include     <fcntl.h>
++#include     <termios.h>
++#include     <errno.h>
++#include     <time.h>
++
++/*
++Xmodem Frame form: <SOH><blk #><255-blk #><--128 data bytes--><CRC hi><CRC lo>
++*/
++
++#define XMODEM_SOH 0x01
++#define XMODEM_STX 0x02
++#define XMODEM_EOT 0x04
++#define XMODEM_ACK 0x06
++#define XMODEM_NAK 0x15
++#define XMODEM_CRC_CHR	'C'
++#define XMODEM_CRC_SIZE 2			/* Crc_High Byte + Crc_Low Byte */
++#define XMODEM_FRAME_ID_SIZE 2 /* Frame_Id + 255-Frame_Id */
++#define XMODEM_DATA_SIZE_SOH 128  /* for Xmodem protocol */
++#define XMODEM_DATA_SIZE_STX 1024 /* for 1K xmodem protocol */
++#define USE_1K_XMODEM 0  /* 1 for use 1k_xmodem 0 for xmodem */
++
++#if (USE_1K_XMODEM)
++	#define XMODEM_DATA_SIZE 	XMODEM_DATA_SIZE_STX
++	#define XMODEM_HEAD		XMODEM_STX
++#else
++	#define XMODEM_DATA_SIZE 	XMODEM_DATA_SIZE_SOH
++	#define XMODEM_HEAD 		XMODEM_SOH
++#endif
++/*********/
++
++#define SERIAL_DEVICE "/dev/ttyS0"
++#define MYBAUDRATE B115200
++
++/***************SUB PROGRAM*******/
++unsigned short GetCrc16 ( char *ptr, unsigned short count )
++{
++	unsigned short crc, i;
++
++	crc = 0;
++	while(count--)
++	{
++		crc = crc ^ (int) *ptr++ << 8;
++	
++		for(i = 0; i < 8; i++)
++		{
++			if(crc & 0x8000)
++				crc = crc << 1 ^ 0x1021;
++			else			
++				crc = crc << 1;
++		}
++	}
++
++	return (crc & 0xFFFF);
++}
++
++/*******************************/
++int Initial_SerialPort(void)
++{
++	int fd;
++	struct termios options;
++
++	fd = open( SERIAL_DEVICE , O_RDWR | O_NOCTTY | O_NDELAY );
++	if ( fd == -1 )
++	{ 
++		/*open error!*/
++		perror("Can't open serial port!");
++		return -1;
++	}
++
++	/*Get the current options for the port...*/
++	tcgetattr(fd, &options);
++
++	/*Set the baud rates to BAUDRATE...*/
++	cfsetispeed(&options,MYBAUDRATE);
++	cfsetospeed(&options,MYBAUDRATE);
++	tcsetattr(fd, TCSANOW, &options);
++	if (0 != tcgetattr(fd, &options)) 
++	{
++		perror("SetupSerial 1");
++		return -1;
++	} 
++	
++	/*
++	 * 8bit Data,no partity,1 stop bit...
++	 */
++	options.c_cflag &= ~PARENB;
++	options.c_cflag &= ~CSTOPB;
++	options.c_cflag &= ~CSIZE;
++	options.c_cflag |= CS8;
++	tcflush(fd,TCIFLUSH);
++
++	/***Choosing Raw Input*/
++	options.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
++	options.c_oflag &= ~OPOST; 
++
++	/*
++	 * Set the new options for the port...
++	 */
++	if (0 != tcsetattr(fd, TCSANOW, &options))
++	{
++ 		perror("SetupSerial error");
++ 		return -1 ;
++	}
++
++	return fd ;
++}
++
++/******************************/
++void ClearReceiveBuffer(int fd)
++{
++	unsigned char tmp;
++	while ((read(fd,&tmp,1))>0);
++	
++	return;
++}
++
++/********************************/
++int main(int argc,char *argv[])
++{
++	int fd;
++	char *data_file_name;
++	char packet_data[ XMODEM_DATA_SIZE ];
++	char frame_data[ XMODEM_DATA_SIZE + XMODEM_CRC_SIZE + XMODEM_FRAME_ID_SIZE + 1 ];
++	FILE *datafile;
++	int complete,retry_num,pack_counter,read_number,write_number,i;
++	unsigned short crc_value;
++	unsigned char ack_id;
++
++	printf("sx-at91 started...\r\n");
++	
++	/* open serial port1 */
++	if ( (fd = Initial_SerialPort()) == -1)  
++		return -1 ;
++
++	data_file_name = argv[1];
++
++	if((datafile=fopen(data_file_name,"rb"))==NULL)
++	{
++		perror ("Can't open file!");
++		return -1 ;
++	}
++
++	/*******************************/
++	
++	pack_counter = 0;
++	complete = 0;
++	retry_num = 0;
++	ClearReceiveBuffer(fd);
++
++	while((read(fd,&ack_id,1))<=0);
++	
++	printf("%c\r\n",ack_id);
++	ack_id=XMODEM_ACK;
++	while(!complete)
++	{
++		switch(ack_id)
++		{
++		case XMODEM_ACK:
++			retry_num = 0;
++			pack_counter++;
++			read_number = fread( packet_data, sizeof(char), XMODEM_DATA_SIZE, datafile);
++			if(read_number>0)
++			{
++				if(read_number<XMODEM_DATA_SIZE_SOH)
++				{
++			
++					printf("Start filling the last frame!\r\n");
++					for(;read_number<XMODEM_DATA_SIZE;read_number++)
++						packet_data[read_number] = 0x00;
++				}
++				frame_data[0] = XMODEM_HEAD;
++				frame_data[1] = (char)pack_counter;
++				frame_data[2] = (char)(255-frame_data[1]);
++	
++				for(i=0;i<XMODEM_DATA_SIZE;i++)
++					frame_data[i+3]=packet_data[i];
++	
++				crc_value = GetCrc16(packet_data,XMODEM_DATA_SIZE);
++				frame_data[XMODEM_DATA_SIZE_SOH+3]=(unsigned char)(crc_value >> 8);
++				frame_data[XMODEM_DATA_SIZE_SOH+4]=(unsigned char)(crc_value);
++				write_number = write( fd, frame_data, XMODEM_DATA_SIZE_SOH + 5);
++				printf("waiting for ACK,%d,%d,...",pack_counter,write_number);
++				while((read(fd,&ack_id,1))<=0);
++			
++				if(ack_id == XMODEM_ACK)
++					printf("Ok!\r\n");
++				else
++					printf("Error!\r\n");
++			}
++			else
++			{
++				ack_id = XMODEM_EOT;
++				complete = 1;
++				printf("Waiting for complete ACK ...");
++			
++				while(ack_id != XMODEM_ACK)
++				{
++					ack_id = XMODEM_EOT;	
++					write_number=write(fd,&ack_id,1);
++					while((read(fd,&ack_id,1))<=0);
++				}
++				printf("OK\r\n");
++		
++				printf("Sending file complete\r\n");
++			}
++		break;
++
++		case XMODEM_NAK:
++			if( retry_num++ > 10) 
++			{
++				printf("Retry too many times,Quit!\r\n");
++				complete = 1;
++			}
++			else
++			{
++				write_number = write(fd,frame_data,XMODEM_DATA_SIZE + 5);
++				printf("Retry for ACK,%d,%d...",pack_counter,write_number);
++				while((read(fd,&ack_id,1))<=0);
++				
++				if( ack_id == XMODEM_ACK )
++					printf("OK\r\n");
++				else
++					printf("Error!\r\n");
++			}
++		break;
++
++		default:
++			printf("Fatal Error!\r\n");
++			complete = 1;
++		break;
++		}
++
++	}
++
++	fclose(datafile);
++	close(fd);
++
++	return 0;
++}

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2009-01-06 18:13 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-06 16:24 [Buildroot] svn commit: trunk/buildroot/target/u-boot/2009.01-rc1 ulf at uclibc.org
  -- strict thread matches above, loose matches on Subject: below --
2009-01-06 16:24 ulf at uclibc.org
2009-01-06 16:33 ` Peter Korsgaard
2009-01-06 16:21 ulf at uclibc.org
2009-01-06 16:17 ulf at uclibc.org
2009-01-06 16:17 ulf at uclibc.org
2009-01-06 16:32 ` Peter Korsgaard
2009-01-06 16:13 ulf at uclibc.org
2009-01-06 16:10 ulf at uclibc.org
2009-01-06 16:09 ulf at uclibc.org
2009-01-03  0:06 ulf at uclibc.org
2009-01-06 14:37 ` Peter Korsgaard
2009-01-06 15:16   ` Ulf Samuelsson
2009-01-06 15:26     ` Peter Korsgaard
2009-01-06 15:56       ` Ulf Samuelsson
2009-01-06 16:18         ` Peter Korsgaard
2009-01-06 17:22           ` Ulf Samuelsson
2009-01-06 18:13             ` Peter Korsgaard
2009-01-03  0:05 ulf at uclibc.org
2009-01-03  0:04 ulf at uclibc.org
2009-01-06 14:39 ` Peter Korsgaard
2009-01-06 15:20   ` Ulf Samuelsson
2009-01-06 15:28     ` Peter Korsgaard
2009-01-06 16:03       ` Ulf Samuelsson
2009-01-03  0:04 ulf at uclibc.org
2009-01-03  0:03 ulf at uclibc.org

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.