Re: [U-Boot] [PATCH sunxi-tools] WIP: fel: Add a command for loading U-Boot SPL binaries in eGON format

2015-02-07 Thread Hans de Goede
Hi,

On 02/07/2015 04:17 AM, Siarhei Siamashka wrote:
 On Thu, 5 Feb 2015 22:49:39 -0700
 Simon Glass s...@chromium.org wrote:
 
 Hi Siarhei,

 On 5 February 2015 at 02:36, Siarhei Siamashka
 siarhei.siamas...@gmail.com wrote:
 !!! Works only on Allwinner A20 so far and needs a bit more
 !!! debugging. And even on A20, the transition from the SPL to
 !!! the main U-boot binary has some glitches.

 Now it should be possible to load and execute the same U-Boot SPL,
 as used for booting from SD cards. The only argument for this new
 command is the name of the SPL binary file (with eGON header).
 It can be run as:

 fel spl u-boot-sunxi-with-spl.bin

 This looks great! Does it write only the SPL portion or does it write
 U-Boot also?
 
 Yes, it only takes care of the SPL part at the moment, but surely
 this can be improved later.
 
 The biggest inconvenience is that we need to provide the 'fel' tool
 with with the magic address for the main u-boot binary. This address
 is hidden in the u-boot sources:
 
 
 http://git.denx.de/?p=u-boot.git;a=blob;f=include/configs/sunxi-common.h;h=6cfd7e148900#l28
 
 But the users need to know it in order to set in as the command
 line argument for the 'fel' tool.
 
 We could probably do a better job and store the necessary addresses
 in the SPL header. Currently 'mksunxiboot' provides only a
 minimalistic header with the eGON.BT0 signature and a checksum,
 because otherwise it will refuse to boot from the SD card:
 
 http://git.denx.de/?p=u-boot.git;a=blob;f=tools/mksunxiboot.c
 
 But probably we can extend this header and also add the
 CONFIG_SYS_TEXT_BASE value there. Together with kernel_addr_r,
 fdt_addr_r, scriptaddr and ramdisk_addr_r values.
 After this change, the 'fel' tool will be able to extract all
 the necessary information from u-boot-sunxi-with-spl.bin
 file without relying on the command line too much.
 Moreover, these addresses are sometimes changing, and some
 users are IMHO rightfully upset whenever this happens:

I think that adding a new header for this sounds like a good idea, this
header should start with some 8 byte magic marker so that the fel tool
can be 100% sure if it is there.

 http://permalink.gmane.org/gmane.comp.hardware.netbook.arm.sunxi/14919
 
 I don't really understand how it works but will leave that to you and Hans.
  
 OK :) Anyway, now I have finally pushed a supposedly properly working
 implementation to the following github branch:
 
 https://github.com/ssvb/sunxi-tools/commits/20150206-fel-large-spl-support

Cool (note I've not looked at the actual code yet), this all sounds quite
nice.

It would be really cool if when the new header is present and with a new
enough fel tool + u-boot bin we could do:

fel spl u-boot-sunxi-with-spl.bin zImage - dtb

or:

fel spl u-boot-sunxi-with-spl.bin zImage initrd dtb

And everything would just work, note that the zImage initrd dtb order
is the same as u-boot's bootm command, and the - is there to indicate
there is no initrd.

Maybe we should also do something for old kernels where script.bin needs
to be loaded, maybe:

fel spl-old-kernel ... ??



 Yes, we can handle most of this stuff with Hans. But some communication
 with you is still needed. In particular, we still need to decide a way
 to distinguish between booting from the SD card and over USB. Your
 RFC/WIP patch from
 http://lists.denx.de/pipermail/u-boot/2015-February/203858.html
 was checking the value in the 'lr' register, but this is not going to
 work anymore. To address this, right now I'm just replacing the
 eGON.BT0 signature in memory to a new eGON.FEL signature at the
 address 0x0004. The idea is that this signature is critical for booting
 from the SD card. If there is some other value instead, then we are
 pretty sure that the SPL was not booted from the SD card. And having it
 as eGON.FEL serves as an indication of what exactly it is.

I think that replacing eGON.BT0 with eGON.FEL when loading the SPL
through the new mode is a good way of doing this, ACK to that.

 Additionally, we might even not need to store the lr and sp
 registers in save_boot_params(). If we settle on using the eGON.FEL
 signature in memory for distinguishing between the FEL and the SD boot,
 then we can also reuse the other parts of of header (for example,
 the checksum) to store the return address.

We'll have to see how this all works out to determine whether or not that
is a good idea.

 As you have figured out earlier, avoiding setting VBAR and CP15
 stuff is important. Right now the FEL code in the BROM has an
 active interrupt handler in use (which I'm suppressing by disabling
 interrupts early) and the SPL needs to keep interrupts disabled,
 while trying not to mess its configuration.

Ack.

Regards,

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


[U-Boot] [PATCH v2] config_distro_bootcmd.h: Enable CONFIG_CMD_PART

2015-02-07 Thread Hans de Goede
The recent changes to config_distro_bootcmd.h require CONFIG_CMD_PART to be
defined, as the default bootcmd now uses the part command.

This fixes sunxi boards not booting with v2015.04-rc1.

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 include/config_distro_bootcmd.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 49674f4..07a0b3b 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -10,6 +10,10 @@
 #ifndef _CONFIG_CMD_DISTRO_BOOTCMD_H
 #define _CONFIG_CMD_DISTRO_BOOTCMD_H
 
+/* We need the part command */
+#define CONFIG_PARTITION_UUIDS
+#define CONFIG_CMD_PART
+
 #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \
if  #devtypel  dev ${devnum}; then  \
setenv devtype  #devtypel ;  \
-- 
2.2.2

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


[U-Boot] [PATCH v2] config_distro_bootcmd.h: Enable CONFIG_CMD_PART

2015-02-07 Thread Hans de Goede
Hi Stephen  Tom,

Here is v2 of the patch to fix config_distro_bootcmd usage for sunxi
(and possibly others). As requested I've removed the enabling of
CONFIG_CMD_PART to config_distro_bootcmd.h .

Stephen, can you please review and ack ?

Tom, can you please merge this once acked ?

Regards,

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


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Jeroen Hofstee

Hi Simon,

On 06-02-15 22:00, Simon Glass wrote:

Hi,

On 6 February 2015 at 13:40, Andreas Bießmann
andreas.de...@googlemail.com wrote:

Hi,

On 06.02.15 20:56, Jeroen Hofstee wrote:

Hello Simon, +Andreas,

On 06-02-15 04:05, Simon Glass wrote:

Hi Jeroen,

On 5 February 2015 at 12:51, Jeroen Hofsteejer...@myspectrum.nl  wrote:

Hello Guilherme,

Thanks for commenting on this,

On 02/05/15 13:27, Guilherme Maciel Ferreira wrote:

Hi Jeroen,

My apologies, I didn't test the tools on BSD. The answers are inline.

Best regards,
Guilherme

Am 04.02.2015 19:37 schrieb Jeroen Hofsteejer...@myspectrum.nl:

Regarding the linking problem, there is nothing special about FreeBSD ld,
it just is based on a version which has no idea what INSERT BEFORE .data
means.

there are several option I guess (not tested):
1) include a complete linker script so INSERT BEFORE .data is not needed
2) teach FreeBSD ld what INSERT BEFORE .data is supposed to mean
3) don't use linker magic in tools (and use a linux box for sandbox, at
least for now)

1) sounds like a bad idea, the target/host might be any arch e.g.
2) won't magically fix problems as well, even if FreeBSD trunk can be
teached to understand
this, things will still be broken on releases. And u-boot tools work on
more host systems,
Andreas, can you check if Darwin is still able to compile tools from
u-boot master?

unfortunately it does not.

---8---
andreas@imac % git describe
v2015.04-rc1-4-g7f641d5
andreas@imac %
PATH=/Volumes/crosstool-ng/arm-unknown-linux-uclibcgnueabi/bin:$PATH
make CROSS_COMPILE=arm-unknown-linux-uclibcgnueabi- V=1
...
gcc  -T ./tools/imagetool.lds -o tools/envcrc tools/envcrc.o
tools/lib/crc32.o tools/common/env_embedded.o tools/lib/sha1.o
ld: unknown option: -T
collect2: error: ld returned 1 exit status
make[1]: *** [tools/envcrc] Error 1
make: *** [tools] Error 2
andreas@imac % gcc --version
gcc (MacPorts gcc49 4.9.2_1) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
---8---


3) the option I would be tempted to choose, just don't do linker magic
for tools. This would
make sure at least mkimage etc can be build everywhere. sandbox won't
build, but as said
it is already broken because of other issues. (and I doubt there is even
an single user around
besides me to even try to build sandbox on FreeBSD).

So as far as I am concerned we go for option 3.

+1

Dynamic list-sections is in general a good thing. But beside the linker
problem here we will get another problem on darwin hosts when we want to
read the sections. I added a patch to linux kernel to get around [1].

So I have another option here:

4) setup the lists sections in code, add the magic handling for Mach-O
binaries and remove the linker foo.

The lower-common-denominator approach is a bit frustrating. How does
FreeBSD compile U-Boot?


I guess I am missing the point here. U-boot v2015.01 builds fine
on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
which no longer builds mkimage on FreeBSD and Darwin.


What are you actually using that system for if
it cannot build U-Boot?


I am missing the point, u-boot and its tools build fine until v2015.04-rc1
on FreeBSD and a mac. And this is easily fixed by not using linker magic
for tools. (and yes sandbox likely fails to build, but I don't care that 
much)

Re 1) I found an open in ld to produce the standard link script. I
actually used that before I found INSERT BEFORE.

Before giving up I think it would be worth exploring 1). It should
then be possible to make sandbox work also.


I am not giving up, I think it is sane if a tool which adds a header and
a checksum does not use linker magic.  Sandbox biggest problem is
not the linking, but the fact that linux headers and std* are included,
it is a different topic.


Finally, please point me to how I can install FreeBSD in viritualbox
or similar. I'm interested in that...


Just download an install image and start it in virtualbox, see 1.
You might need to change the motherboard type.

doc/README.clang explains how to use the host compiler to cross build
u-boot (for some boards). You can install a gcc cross compiler as well.

[1] https://www.freebsd.org/releases/10.1R/announce.html

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


Re: [U-Boot] [u-boot 00/40] dra7xx: am43xx: add dwc3 gadget driver support and enable dfu

2015-02-07 Thread Marek Vasut
On Friday, February 06, 2015 at 09:47:37 AM, Kishon Vijay Abraham I wrote:
 This patch series ports dwc3 gadget driver from linux kernel (3.19-rc1)
 to u-boot.
 
 Changes from RFC:
 *) A patch has been added to copy the driver from linux kernel to u-boot
 and then it's modfied to make it work in u-boot. This will help to
 understand the changes that's been done to make it work in u-boot and will
 also be easier to review. *) Implemented chained TRB support in dwc3 ep0
 so that we need not increase the size of bounce buffer
 
 Testing:
 *) tested DFU RAM and DFU MMC in dra7xx and am43xx
 
 TODO:
 *) Add Kconfig support
 *) Adapt dwc3 driver to use the driver model.
 *) Make composite driver similar to the one in linux kernel.
 
 Pushed these patches to
 git://git.ti.com/~kishon/ti-u-boot/kishons-ti-u-boot.git dwc3_upstream_v1

Hi!

I'm fine with this series, maybe just replace folder with directory in
the commit messages ;-) But I can do that myself if you don't mind, no need
to repost.

I'd like to hear what Lukasz thinks and then I'll likely just pick it up for
this MW.

Thanks!

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


Re: [U-Boot] [PATCHv1 13/22] arm: socfpga: spl: Add s_init

2015-02-07 Thread Marek Vasut
On Thursday, February 05, 2015 at 10:16:59 PM, Dinh Nguyen wrote:
 On 01/14/2015 05:54 PM, Marek Vasut wrote:

[...]

  +  /*
  +   * Private components security
  +   * U-Boot : configure private timer, global timer and cpu
  +   * component access as non secure for kernel stage (as required
  +   * by kernel)
  +   */
  +  setbits_le32(SOCFPGA_SCU_SNSAC, 0xfff);
  
  We do this in socfpga/misc.c in arch_early_init_r() already. You should
  consolidate this code so we don't have it twice I think.
 
 Yes, this can be removed.

Hi! Please use whichever place you think is better.

  +
  +#endif/* CONFIG_SPL_BUILD */
  +
  +  /* Configure the L2 controller to make SDRAM start at 0 */
  +  writel(0x1, (SOCFPGA_MPUL2_ADDRESS + SOCFPGA_MPUL2_ADRFLTR_START));
  
  This as well.
 
 This call has to stay because we want to map the SDRAM to 0x0 in the
 SPL. The call in arch_early_init_r() is in u-boot, and thus is too late.

Roger, but please remove the other invocation once the SPL is in place. OK?

[...]

  +/*
  + * SCU Non-secure Access Control
  + */
  +#define SOCFPGA_SCU_SNSAC (SOCFPGA_MPUSCU_ADDRESS + 0x54)
  +/*
  + * L2 PL-310
  + * for configuring L2 address filtering start address in assembly.
  + */
  +#define SOCFPGA_MPUL2_ADRFLTR_START   (0xC00)
  
  I think this is not needed if you use the code from misc.c , since these
  registers are already defined there.
 
 Yes, I can remove this and use the mappings already defined.

Please do :)

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


Re: [U-Boot] [u-boot 03/40] usb: gadget: udc: add udc-core from linux kernel to u-boot

2015-02-07 Thread Marek Vasut
On Friday, February 06, 2015 at 09:47:40 AM, Kishon Vijay Abraham I wrote:
 Added udc-core.c from linux kernel 3.19-rc1 (97bf6af1f9) to u-boot.
 This will be adapted to work with u-boot in the
 following patches.
 Adding support for udc will help to seamlessly port dwc3 driver from
 linux kernel to u-boot (since dwc3 uses udc-core) and it'll also help
 to add support for multiple gadget controllers to be functional at the
 same time.
 All other gadget drivers can also be adapted to use udc-core.
 
 Signed-off-by: Kishon Vijay Abraham I kis...@ti.com

Lukasz, do you have any comments on this ? I'd like to pick this whole
thing via u-boot-usb for this MW if possible.

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


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Simon Glass
Hi Jeroen,

On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:
 Hi Simon,

 On 06-02-15 22:00, Simon Glass wrote:

 Hi,

 On 6 February 2015 at 13:40, Andreas Bießmann
 andreas.de...@googlemail.com wrote:

 Hi,

 On 06.02.15 20:56, Jeroen Hofstee wrote:

 Hello Simon, +Andreas,

 On 06-02-15 04:05, Simon Glass wrote:

 Hi Jeroen,

 On 5 February 2015 at 12:51, Jeroen Hofsteejer...@myspectrum.nl
 wrote:

 Hello Guilherme,

 Thanks for commenting on this,

 On 02/05/15 13:27, Guilherme Maciel Ferreira wrote:

 Hi Jeroen,

 My apologies, I didn't test the tools on BSD. The answers are inline.

 Best regards,
 Guilherme

 Am 04.02.2015 19:37 schrieb Jeroen Hofsteejer...@myspectrum.nl:

 Regarding the linking problem, there is nothing special about FreeBSD
 ld,
 it just is based on a version which has no idea what INSERT BEFORE .data
 means.

 there are several option I guess (not tested):
 1) include a complete linker script so INSERT BEFORE .data is not needed
 2) teach FreeBSD ld what INSERT BEFORE .data is supposed to mean
 3) don't use linker magic in tools (and use a linux box for sandbox, at
 least for now)

 1) sounds like a bad idea, the target/host might be any arch e.g.
 2) won't magically fix problems as well, even if FreeBSD trunk can be
 teached to understand
 this, things will still be broken on releases. And u-boot tools work on
 more host systems,
 Andreas, can you check if Darwin is still able to compile tools from
 u-boot master?

 unfortunately it does not.

 ---8---
 andreas@imac % git describe
 v2015.04-rc1-4-g7f641d5
 andreas@imac %
 PATH=/Volumes/crosstool-ng/arm-unknown-linux-uclibcgnueabi/bin:$PATH
 make CROSS_COMPILE=arm-unknown-linux-uclibcgnueabi- V=1
 ...
 gcc  -T ./tools/imagetool.lds -o tools/envcrc tools/envcrc.o
 tools/lib/crc32.o tools/common/env_embedded.o tools/lib/sha1.o
 ld: unknown option: -T
 collect2: error: ld returned 1 exit status
 make[1]: *** [tools/envcrc] Error 1
 make: *** [tools] Error 2
 andreas@imac % gcc --version
 gcc (MacPorts gcc49 4.9.2_1) 4.9.2
 Copyright (C) 2014 Free Software Foundation, Inc.
 This is free software; see the source for copying conditions.  There is
 NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
 PURPOSE.
 ---8---

 3) the option I would be tempted to choose, just don't do linker magic
 for tools. This would
 make sure at least mkimage etc can be build everywhere. sandbox won't
 build, but as said
 it is already broken because of other issues. (and I doubt there is even
 an single user around
 besides me to even try to build sandbox on FreeBSD).

 So as far as I am concerned we go for option 3.

 +1

 Dynamic list-sections is in general a good thing. But beside the linker
 problem here we will get another problem on darwin hosts when we want to
 read the sections. I added a patch to linux kernel to get around [1].

 So I have another option here:

 4) setup the lists sections in code, add the magic handling for Mach-O
 binaries and remove the linker foo.

 The lower-common-denominator approach is a bit frustrating. How does
 FreeBSD compile U-Boot?


 I guess I am missing the point here. U-boot v2015.01 builds fine
 on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
 which no longer builds mkimage on FreeBSD and Darwin.

 What are you actually using that system for if
 it cannot build U-Boot?


 I am missing the point, u-boot and its tools build fine until v2015.04-rc1
 on FreeBSD and a mac. And this is easily fixed by not using linker magic
 for tools. (and yes sandbox likely fails to build, but I don't care that
 much)

How do you build U-Boot for any of the boards supported? What I mean
is that if you can't handle linker scripts in FreeBSD how do you build
anything beyond the 'tools' build?

The docs for 'ld' seem to indicate that if the -T option is not used
the file is treated as a link script addendum rather than replacing it
entirely. Is that what we want?


 Re 1) I found an open in ld to produce the standard link script. I
 actually used that before I found INSERT BEFORE.

 Before giving up I think it would be worth exploring 1). It should
 then be possible to make sandbox work also.


 I am not giving up, I think it is sane if a tool which adds a header and
 a checksum does not use linker magic.  Sandbox biggest problem is
 not the linking, but the fact that linux headers and std* are included,
 it is a different topic.

This should be easy to fix in os.c since all the inclusions are
isolated to there. I'd been keen to see a patch for that. Also if you
want LCD support, sdl.c.

 Finally, please point me to how I can install FreeBSD in viritualbox
 or similar. I'm interested in that...


 Just download an install image and start it in virtualbox, see 1.
 You might need to change the motherboard type.

 doc/README.clang explains how to use the host compiler to cross build
 u-boot (for some boards). You can install a gcc cross compiler as well.

 [1] 

Re: [U-Boot] x86: ACPI support suggestion

2015-02-07 Thread Gabriel Huau

Hi Simon,

On 02/06/2015 03:14 PM, Simon Glass wrote:

Hi,

On 6 February 2015 at 16:11, Gabriel Huau cont...@huau-gabriel.fr wrote:

Hi Simon,


On 02/06/2015 03:04 PM, Simon Glass wrote:

Hi Gabriel,

On 6 February 2015 at 16:01, Gabriel Huau cont...@huau-gabriel.fr wrote:

Hi Bin,

Actually I was able to try with a quickdirty code the integration of the
ACPI tables (aml files) and it doesn't seem to be possible.
The boot to Linux is working fine, all the ACPI tables are loaded
correctly,
but the system is unstable and it seems to have some issue with the
interrupts handler.

As debugging this kind of issues could be really tricky and involve also
a
lot of modification, I think we are stuck to port the ACPI support from
coreboot to u-boot.

I will try to work on a first draft and see how things look like.

One thing to note is that U-Boot may not currently set up the PCI
interrupts fully. Or perhaps the problem is that ACPI needs to match.
What platform are you using?

[snip]


MinnowBoard Max (BayTrail).

Actually, you may be right, I didn't check this part.


Actually that uses an FSP so might already be correct, but it is
certainly worth checking.


I just checked the dmesg again and I didn't see that the first time:

[0.723098] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 12 14 
15) *0, disabled.
[0.732328] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 11 12 14 
15) *0, disabled.
[0.741551] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 10 12 14 
15) *0, disabled.
[0.750782] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 11 12 14 
15) *0, disabled.
[0.760006] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 10 12 14 
15) *0, disabled.


So I believe the PIRQ routing is missing in u-boot. I checked in the 
source of Coreboot, and actually everything is done in the southcluster 
initialization.
Also, I saw that the GPIO iomap wasn't done and it appeared that the 
USB2 port wasn't powered up (the white one), enabling the port allow us 
to use of both port in the EHCI mode.


I'll give a try to initialize the PIRQ and see how things is going.


Regards,
Simon


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


Re: [U-Boot] [PATCH v2 15/19] dm: sunxi: Move driver model CONFIGs to Kconfig

2015-02-07 Thread Simon Glass
On 6 February 2015 at 21:22, Ian Campbell i...@hellion.org.uk wrote:
 On Thu, 2015-02-05 at 21:41 -0700, Simon Glass wrote:
 Remove driver model CONFIGs from the board config headers and use Kconfig
 instead.

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

 Acked-by: Ian Campbell i...@hellion.org.uk

 I assume you'll take this via the dm tree along with the rest of the
 series.

Thanks - yes, but will give it a few days to wait for more comments.

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


Re: [U-Boot] x86: ACPI support suggestion

2015-02-07 Thread Simon Glass
Hi Gabriel,

On 7 February 2015 at 08:07, Gabriel Huau cont...@huau-gabriel.fr wrote:
 Hi Simon,


 On 02/06/2015 03:14 PM, Simon Glass wrote:

 Hi,

 On 6 February 2015 at 16:11, Gabriel Huau cont...@huau-gabriel.fr wrote:

 Hi Simon,


 On 02/06/2015 03:04 PM, Simon Glass wrote:

 Hi Gabriel,

 On 6 February 2015 at 16:01, Gabriel Huau cont...@huau-gabriel.fr
 wrote:

 Hi Bin,

 Actually I was able to try with a quickdirty code the integration of
 the
 ACPI tables (aml files) and it doesn't seem to be possible.
 The boot to Linux is working fine, all the ACPI tables are loaded
 correctly,
 but the system is unstable and it seems to have some issue with the
 interrupts handler.

 As debugging this kind of issues could be really tricky and involve
 also
 a
 lot of modification, I think we are stuck to port the ACPI support from
 coreboot to u-boot.

 I will try to work on a first draft and see how things look like.

 One thing to note is that U-Boot may not currently set up the PCI
 interrupts fully. Or perhaps the problem is that ACPI needs to match.
 What platform are you using?

 [snip]


 MinnowBoard Max (BayTrail).

 Actually, you may be right, I didn't check this part.

 Actually that uses an FSP so might already be correct, but it is
 certainly worth checking.


 I just checked the dmesg again and I didn't see that the first time:

 [0.723098] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 12 14 15)
 *0, disabled.
 [0.732328] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 11 12 14 15)
 *0, disabled.
 [0.741551] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 10 12 14 15)
 *0, disabled.
 [0.750782] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 11 12 14 15)
 *0, disabled.
 [0.760006] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 10 12 14 15)
 *0, disabled.

 So I believe the PIRQ routing is missing in u-boot. I checked in the source
 of Coreboot, and actually everything is done in the southcluster
 initialization.
 Also, I saw that the GPIO iomap wasn't done and it appeared that the USB2
 port wasn't powered up (the white one), enabling the port allow us to use of
 both port in the EHCI mode.

 I'll give a try to initialize the PIRQ and see how things is going.

OK, sounds good.

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


Re: [U-Boot] [PATCH v2 3/3] sunxi: Normalise FEL support

2015-02-07 Thread Hans de Goede

Hi,

On 02/07/2015 06:47 PM, Simon Glass wrote:

Make sunxi's FEL code fit with the normal U-Boot boot sequence instead of
creating its own. There are some #ifdefs required in start.S. Future work
will hopefully remove these.


About the #ifdefs, I would really like to see us move to having 1 unified
loader for sunxi, which means getting rid of them. Even though we do use
a label to return from save_boot_params, save_boot_params could still
use r0 to return stuff, like you did in your previous patch-set, or we
could add a global variable to start.S which lives in .data and gets
initialized with 0, and save_boot_params could optionally save some
skip flags there.

Note this dropping of #ifdefs can wait till after v2015.04, for now this
patch-set should get fel mode working as before which is the goal for
v2015.04.

Regards,

Hans



This series is available at u-boot-dm, branch sunxi-working.

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

Changes in v2:
- Adjust for new save_boot_params() API
- Drop patch to change r0 to r2 in start.S
- Add #ifdefs to start.S to deal with FEL
- Use 'Fast Early Loader' as the full name for FEL

  arch/arm/cpu/armv7/start.S  |  5 +-
  arch/arm/cpu/armv7/sunxi/Makefile   |  4 +-
  arch/arm/cpu/armv7/sunxi/board.c| 21 
  arch/arm/cpu/armv7/sunxi/config.mk  |  2 -
  arch/arm/cpu/armv7/sunxi/fel_utils.S| 25 +
  arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds | 82 -
  arch/arm/include/asm/arch-sunxi/sys_proto.h | 10 
  board/sunxi/Kconfig | 10 
  include/configs/sunxi-common.h  |  6 +--
  scripts/Makefile.spl|  2 -
  10 files changed, 73 insertions(+), 94 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/sunxi/fel_utils.S
  delete mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 9b49ece..098a83a 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -54,7 +54,8 @@ save_boot_params_ret:
   * (OMAP4 spl TEXT_BASE is not 32 byte aligned.
   * Continue to use ROM code vector only in OMAP4 spl)
   */
-#if !(defined(CONFIG_OMAP44XX)  defined(CONFIG_SPL_BUILD))
+#if !(defined(CONFIG_OMAP44XX)  defined(CONFIG_SPL_BUILD))  \
+   !defined(CONFIG_SPL_FEL)
/* Set V=0 in CP15 SCTLR register - for VBAR to point to vector */
mrc p15, 0, r0, c1, c0, 0   @ Read CP15 SCTLR Register
bic r0, #CR_V   @ V = 0
@@ -67,7 +68,9 @@ save_boot_params_ret:

/* the mask ROM code should have PLL and others stable */
  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifndef CONFIG_SPL_FEL
bl  cpu_init_cp15
+#endif
bl  cpu_init_crit
  #endif

diff --git a/arch/arm/cpu/armv7/sunxi/Makefile 
b/arch/arm/cpu/armv7/sunxi/Makefile
index 48db744..c1b975a 100644
--- a/arch/arm/cpu/armv7/sunxi/Makefile
+++ b/arch/arm/cpu/armv7/sunxi/Makefile
@@ -38,7 +38,5 @@ obj-$(CONFIG_MACH_SUN5I)  += dram_sun4i.o
  obj-$(CONFIG_MACH_SUN6I)  += dram_sun6i.o
  obj-$(CONFIG_MACH_SUN7I)  += dram_sun4i.o
  obj-$(CONFIG_MACH_SUN8I)  += dram_sun8i.o
-ifdef CONFIG_SPL_FEL
-obj-y  += start.o
-endif
+obj-y  += fel_utils.o
  endif
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 6e28bcd..b7492ac 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -27,6 +27,13 @@

  #include linux/compiler.h

+struct fel_stash {
+   uint32_t sp;
+   uint32_t lr;
+};
+
+struct fel_stash fel_stash __attribute__((section(.data)));
+
  static int gpio_init(void)
  {
  #if CONFIG_CONS_INDEX == 1  defined(CONFIG_UART0_PORT_F)
@@ -65,6 +72,12 @@ static int gpio_init(void)
return 0;
  }

+void spl_board_load_image(void)
+{
+   debug(Returning to FEL sp=%x, lr=%x\n, fel_stash.sp, fel_stash.lr);
+   return_to_fel(fel_stash.sp, fel_stash.lr);
+}
+
  void s_init(void)
  {
  #if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I
@@ -95,6 +108,14 @@ void s_init(void)
   */
  u32 spl_boot_device(void)
  {
+   /*
+* Have we been asked to return to the FEL portion of the boot ROM?
+* TODO: We need a more robust test here, or bracket this with
+* #ifdef CONFIG_SPL_FEL.
+*/
+   if (fel_stash.lr = 0x  fel_stash.lr  0x4000)
+   return BOOT_DEVICE_BOARD;
+
return BOOT_DEVICE_MMC1;
  }

diff --git a/arch/arm/cpu/armv7/sunxi/config.mk 
b/arch/arm/cpu/armv7/sunxi/config.mk
index 00f5ffc..76ffec9 100644
--- a/arch/arm/cpu/armv7/sunxi/config.mk
+++ b/arch/arm/cpu/armv7/sunxi/config.mk
@@ -1,8 +1,6 @@
  # Build a combined spl + u-boot image
  ifdef CONFIG_SPL
  ifndef CONFIG_SPL_BUILD
-ifndef CONFIG_SPL_FEL
  ALL-y += u-boot-sunxi-with-spl.bin
  endif
  endif
-endif
diff --git a/arch/arm/cpu/armv7/sunxi/fel_utils.S 
b/arch/arm/cpu/armv7/sunxi/fel_utils.S
new file 

Re: [U-Boot] [PATCH v2 3/3] sunxi: Normalise FEL support

2015-02-07 Thread Simon Glass
Hi Hans,

On 7 February 2015 at 10:59, Hans de Goede hdego...@redhat.com wrote:
 Hi,

 On 02/07/2015 06:47 PM, Simon Glass wrote:

 Make sunxi's FEL code fit with the normal U-Boot boot sequence instead of
 creating its own. There are some #ifdefs required in start.S. Future work
 will hopefully remove these.


 About the #ifdefs, I would really like to see us move to having 1 unified
 loader for sunxi, which means getting rid of them. Even though we do use
 a label to return from save_boot_params, save_boot_params could still
 use r0 to return stuff, like you did in your previous patch-set, or we
 could add a global variable to start.S which lives in .data and gets
 initialized with 0, and save_boot_params could optionally save some
 skip flags there.

 Note this dropping of #ifdefs can wait till after v2015.04, for now this
 patch-set should get fel mode working as before which is the goal for
 v2015.04.

OK. It's just as easy for me to do this now, but Albert was not keen
on doing this at run-time.

So if you can remove the #ifdefs by calling back into the BROM that
would probably be better. For now I think Albert prefers the #ifdefs.

 This series is available at u-boot-dm, branch sunxi-working.

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


[snip]

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


[U-Boot] [PATCH v2 02/19] powerpc: Permit device tree control of U-Boot (CONFIG_OF_CONTROL)

2015-02-07 Thread Simon Glass
Enable this in the Kconfig so that PowerPC boards can use device tree to
configure U-Boot.

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

Changes in v2: None

 arch/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index f63cc5a..67e99e9 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -39,6 +39,7 @@ config OPENRISC
 config PPC
bool PowerPC architecture
select HAVE_PRIVATE_LIBGCC
+   select SUPPORT_OF_CONTROL
 
 config SANDBOX
bool Sandbox
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 14/19] powerpc: Add serial driver for driver model

2015-02-07 Thread Simon Glass
This uses the ns16550 driver but sets up the clock at run-time. It does
not seem to be available in the device tree.

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

Changes in v2: None

 drivers/serial/Makefile |  1 +
 drivers/serial/serial_ppc.c | 40 
 2 files changed, 41 insertions(+)
 create mode 100644 drivers/serial/serial_ppc.c

diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 4cc00cd..63b0cbf 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -8,6 +8,7 @@
 ifdef CONFIG_DM_SERIAL
 obj-y += serial-uclass.o
 obj-$(CONFIG_PL01X_SERIAL) += serial_pl01x.o
+obj-$(CONFIG_PPC) += serial_ppc.o
 else
 obj-y += serial.o
 obj-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
diff --git a/drivers/serial/serial_ppc.c b/drivers/serial/serial_ppc.c
new file mode 100644
index 000..47141c6
--- /dev/null
+++ b/drivers/serial/serial_ppc.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+#include dm.h
+#include ns16550.h
+#include serial.h
+
+static const struct udevice_id ppc_serial_ids[] = {
+   { .compatible = ns16550 },
+   { }
+};
+
+static int ppc_serial_ofdata_to_platdata(struct udevice *dev)
+{
+   struct ns16550_platdata *plat = dev_get_platdata(dev);
+   int ret;
+
+   ret = ns16550_serial_ofdata_to_platdata(dev);
+   if (ret)
+   return ret;
+   plat-clock = get_serial_clock();
+
+   return 0;
+}
+
+U_BOOT_DRIVER(serial_ns16550) = {
+   .name   = serial_ppc,
+   .id = UCLASS_SERIAL,
+   .of_match = ppc_serial_ids,
+   .ofdata_to_platdata = ppc_serial_ofdata_to_platdata,
+   .platdata_auto_alloc_size = sizeof(struct ns16550_platdata),
+   .priv_auto_alloc_size = sizeof(struct NS16550),
+   .probe = ns16550_serial_probe,
+   .ops= ns16550_serial_ops,
+   .flags  = DM_FLAG_PRE_RELOC,
+};
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 04/19] powerpc: ppc4xx: Move CANYONLANDS/GLACIER/ARCHES to Kconfig

2015-02-07 Thread Simon Glass
Move these options to Kconfig and remove them from the CONFIG files.

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

Changes in v2: None

 board/amcc/canyonlands/Kconfig | 20 
 configs/arches_defconfig   |  2 +-
 configs/canyonlands_defconfig  |  2 +-
 configs/glacier_defconfig  |  2 +-
 include/configs/canyonlands.h  |  2 ++
 5 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig
index 530a6ef..0fc6877 100644
--- a/board/amcc/canyonlands/Kconfig
+++ b/board/amcc/canyonlands/Kconfig
@@ -9,4 +9,24 @@ config SYS_VENDOR
 config SYS_CONFIG_NAME
default canyonlands
 
+choice BOARD_TYPE
+   prompt Select which board to build for
+
+config CANYONLANDS
+   bool Glacier
+   help
+ Select this to build for the Canyonlands 460EX board.
+
+config GLACIER
+   bool Glacier
+   help
+ Select this to build for the Glacier 460GT board.
+
+config ARCHES
+   bool Arches
+   help
+ Select this to build for the Arches dual 460GT board.
+
+endchoice
+
 endif
diff --git a/configs/arches_defconfig b/configs/arches_defconfig
index 18d0a14..60e6ef9 100644
--- a/configs/arches_defconfig
+++ b/configs/arches_defconfig
@@ -1,4 +1,4 @@
-CONFIG_SYS_EXTRA_OPTIONS=ARCHES
 CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
+CONFIG_ARCHES=y
diff --git a/configs/canyonlands_defconfig b/configs/canyonlands_defconfig
index 09b9ab9..37a2b4d 100644
--- a/configs/canyonlands_defconfig
+++ b/configs/canyonlands_defconfig
@@ -1,4 +1,4 @@
-CONFIG_SYS_EXTRA_OPTIONS=CANYONLANDS
 CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
+CONFIG_CANYONLANDS=y
diff --git a/configs/glacier_defconfig b/configs/glacier_defconfig
index 2a66bfb..436b9f8 100644
--- a/configs/glacier_defconfig
+++ b/configs/glacier_defconfig
@@ -1,4 +1,4 @@
-CONFIG_SYS_EXTRA_OPTIONS=GLACIER
 CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
+CONFIG_GLACIER=y
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index 7b1f368..ed790cc 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -11,6 +11,8 @@
 #ifndef __CONFIG_H
 #define __CONFIG_H
 
+#include linux/kconfig.h
+
 /*---
  * High Level Configuration Options
  *--*/
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 07/19] WIP: powerpc: ppc4xx: Somehow BSS is not cleared in RAMBOOT case

2015-02-07 Thread Simon Glass
From: Stefan Roese s...@denx.de

(NOT TO APPLY)

I'm really not sure why this doesn't work in the RAMBOOT case. But BSS
is not cleared and because of this booting crashed / hangs at some
stage later. Something with the GOT calculation / handling is incorrect.

To get this going for now, just clear the BSS again in the C code.

Signed-off-by: Stefan Roese s...@denx.de
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v2: None

 arch/powerpc/lib/board.c | 3 +++
 common/board_r.c | 8 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 91645d3..47654fa 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -108,6 +108,7 @@ DECLARE_GLOBAL_DATA_PTR;
 extern ulong __init_end;
 extern ulong __bss_end;
 ulong monitor_flash_len;
+extern ulong __bss_start;
 
 #if defined(CONFIG_CMD_BEDBUG)
 #include bedbug/type.h
@@ -590,6 +591,8 @@ void board_init_r(gd_t *id, ulong dest_addr)
/* The Malloc area is immediately below the monitor copy in DRAM */
malloc_start = dest_addr - TOTAL_MALLOC_LEN;
 
+   memset(__bss_start, 0, __bss_end - __bss_start);
+
 #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/*
 * The gd-arch.cpu pointer is set to an address in flash before
diff --git a/common/board_r.c b/common/board_r.c
index 68a9448..6900374 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -1,4 +1,4 @@
-/*
+   /*
  * Copyright (c) 2011 The Chromium OS Authors.
  * (C) Copyright 2002-2006
  * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
@@ -870,6 +870,12 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
gd = new_gd;
 #endif
 
+#ifdef CONFIG_GLACIER
+   ulong bss_start = (ulong)__bss_start;
+   ulong bss_end = (ulong)__bss_end;
+   memset((void *)bss_start, 0, bss_end - bss_start);
+#endif
+
 #ifdef CONFIG_NEEDS_MANUAL_RELOC
for (i = 0; i  ARRAY_SIZE(init_sequence_r); i++)
init_sequence_r[i] += gd-reloc_off;
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 01/19] Introduce board_init_f_mem() to handle early memory layout

2015-02-07 Thread Simon Glass
At present on some architectures we set up the following before calling
board_init_f():

   - global_data
   - stack
   - early malloc memory

Adding the code to support early malloc and global data setup to every
arch's assembler start-up is a pain. Also this code is not actually
architecture-specific. We can use common code for all architectures and
with a bit of care we can write this code in C.

Add a new function to deal with this. It should be called after memory
is available, with a pointer to the top of the area that should be used
before relocation. The function will set things up and return the lowest
memory address that it allocated/used. That can then be set as the top
of the stack.

Note that on some archs this function will use the stack, so the stack
pointer should be set to same value as is pased to board_init_f_mem().
A margin of 128 bytes will be left for this stack, so that it is not
overwritten. This means that 64 bytes is wasted by this early call.
This is not strictly necessary on several more modern archs, so we could
remove this at the cost of some arch-dependent code.

With this function there is no-longer any need for the assembler code to
zero global_data or set up the early malloc pointers.

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

Changes in v2:
- Reduce reserved stack space for board_init_f_mem() to 64 bytes

 common/board_f.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/common/board_f.c b/common/board_f.c
index 7953137..07f5118 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -1075,4 +1075,22 @@ void board_init_f_r(void)
/* NOTREACHED - board_init_r() does not return */
hang();
 }
+#else
+ulong board_init_f_mem(ulong top)
+{
+   /* Leave space for the stack we are running with now */
+   top -= 0x40;
+
+   top -= sizeof(struct global_data);
+   top = ALIGN(top, 16);
+   gd = (struct global_data *)top;
+   memset((void *)gd, '\0', sizeof(*gd));
+
+#ifdef CONFIG_SYS_MALLOC_F_LEN
+   top -= CONFIG_SYS_MALLOC_F_LEN;
+   gd-malloc_base = top;
+#endif
+
+   return top;
+}
 #endif /* CONFIG_X86 */
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 03/19] powerpc: ppc4xx: canyonlands: config: Tidy up CONFIGs and config.mk

2015-02-07 Thread Simon Glass
Many CONFIG options have an unnecessary value of 1. CONFIG_440 is set in
the various board config files. Also simplify the CONFIG_440 check in
config.mk

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

Changes in v2: None

 arch/powerpc/cpu/ppc4xx/config.mk |  5 +
 board/amcc/canyonlands/config.mk  |  2 --
 include/configs/canyonlands.h | 34 +-
 3 files changed, 18 insertions(+), 23 deletions(-)

diff --git a/arch/powerpc/cpu/ppc4xx/config.mk 
b/arch/powerpc/cpu/ppc4xx/config.mk
index f87c9dc..9cb41bb 100644
--- a/arch/powerpc/cpu/ppc4xx/config.mk
+++ b/arch/powerpc/cpu/ppc4xx/config.mk
@@ -7,10 +7,7 @@
 
 PLATFORM_CPPFLAGS += -mstring -msoft-float
 
-cfg=$(srctree)/include/configs/$(CONFIG_SYS_CONFIG_NAME:%=%).h
-is440:=$(shell grep CONFIG_440 $(cfg))
-
-ifneq (,$(findstring CONFIG_440,$(is440)))
+ifneq (,$(CONFIG_440))
 PLATFORM_CPPFLAGS += -Wa,-m440 -mcpu=440
 else
 PLATFORM_CPPFLAGS += -Wa,-m405 -mcpu=405
diff --git a/board/amcc/canyonlands/config.mk b/board/amcc/canyonlands/config.mk
index 63b8973..5cc90d2 100644
--- a/board/amcc/canyonlands/config.mk
+++ b/board/amcc/canyonlands/config.mk
@@ -8,8 +8,6 @@
 # AMCC 460EX/460GT Evaluation Board (Canyonlands) board
 #
 
-PLATFORM_CPPFLAGS += -DCONFIG_440=1
-
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index 8eeb15c..7b1f368 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -19,10 +19,10 @@
  * and Arches dual (460GT)
  */
 #ifdef CONFIG_CANYONLANDS
-#define CONFIG_460EX   1   /* Specific PPC460EX*/
+#define CONFIG_460EX   /* Specific PPC460EX*/
 #define CONFIG_HOSTNAMEcanyonlands
 #else
-#define CONFIG_460GT   1   /* Specific PPC460GT*/
+#define CONFIG_460GT   /* Specific PPC460GT*/
 #ifdef CONFIG_GLACIER
 #define CONFIG_HOSTNAMEglacier
 #else
@@ -32,7 +32,7 @@
 #endif
 #endif
 
-#define CONFIG_440 1
+#define CONFIG_440
 
 #ifndef CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_TEXT_BASE   0xFFF8
@@ -45,10 +45,10 @@
 
 #define CONFIG_SYS_CLK_FREQ6667/* external freq to pll */
 
-#define CONFIG_BOARD_EARLY_INIT_F  1   /* Call board_early_init_f */
-#define CONFIG_BOARD_EARLY_INIT_R  1   /* Call board_early_init_r */
-#define CONFIG_MISC_INIT_R 1   /* Call misc_init_r */
-#define CONFIG_BOARD_TYPES 1   /* support board types */
+#define CONFIG_BOARD_EARLY_INIT_F  /* Call board_early_init_f */
+#define CONFIG_BOARD_EARLY_INIT_R  /* Call board_early_init_r */
+#define CONFIG_MISC_INIT_R /* Call misc_init_r */
+#define CONFIG_BOARD_TYPES /* support board types */
 
 /*---
  * Base addresses -- Note these are effective addresses where the
@@ -134,7 +134,7 @@
  *--*/
 #define CONFIG_SYS_FLASH_CFI   /* The flash is CFI compatible  
*/
 #define CONFIG_FLASH_CFI_DRIVER/* Use common CFI driver
*/
-#define CONFIG_SYS_FLASH_CFI_AMD_RESET 1   /* Use AMD (Spansion) reset cmd 
*/
+#define CONFIG_SYS_FLASH_CFI_AMD_RESET /* Use AMD (Spansion) reset cmd */
 
 #define CONFIG_SYS_FLASH_BANKS_LIST{CONFIG_SYS_FLASH_BASE}
 #define CONFIG_SYS_MAX_FLASH_BANKS 1   /* max number of memory banks   
*/
@@ -172,9 +172,9 @@
  * I2C SPD DIMM autodetection/calibration doesn't fit into the 4k of boot
  * code.
  */
-#define CONFIG_SPD_EEPROM  1   /* Use SPD EEPROM for setup */
+#define CONFIG_SPD_EEPROM  /* Use SPD EEPROM for setup */
 #define SPD_EEPROM_ADDRESS {0x50, 0x51}/* SPD i2c spd addresses*/
-#define CONFIG_DDR_ECC 1   /* with ECC support */
+#define CONFIG_DDR_ECC /* with ECC support */
 #define CONFIG_DDR_RQDC_FIXED  0x8038 /* fixed value for RQDC  */
 
 #else /* defined(CONFIG_ARCHES) */
@@ -262,8 +262,8 @@
 #define CONFIG_4xx_CONFIG_BLOCKSIZE16
 
 /* I2C SYSMON (LM75, AD7414 is almost compatible)  */
-#define CONFIG_DTT_LM751   /* ON Semi's LM75   
*/
-#define CONFIG_DTT_AD7414  1   /* use AD7414   */
+#define CONFIG_DTT_LM75/* ON Semi's LM75   
*/
+#define CONFIG_DTT_AD7414  /* use AD7414   */
 #define CONFIG_DTT_SENSORS {0} /* Sensor addresses */
 #define CONFIG_SYS_DTT_MAX_TEMP70
 #define CONFIG_SYS_DTT_LOW_TEMP-30
@@ -275,14 +275,14 @@
 
 #if !defined(CONFIG_ARCHES)
 /* RTC configuration */
-#define CONFIG_RTC_M41T62  1
+#define CONFIG_RTC_M41T62
 #define 

[U-Boot] [PATCH v2 0/19] powerpc: Introduce device tree control and driver model

2015-02-07 Thread Simon Glass
This series does a small amount of tweaking to support device tree control
(CONFIG_OF_CONTROL) on PowerPC platforms. It also adds support for driver
model. In both cases the main effort is to set things up correctly before
calling board_init_f().

A new generic function, board_init_f_mem() is introduced. This does the
various memory calculations in C code, since they are messy in assembler
and every architecture should in fact be the same. A later series will
adjust ARM and x86 to use this function.

As an example, the Canyonlands boards are converted over to use device tree
control and driver model for their serial console. It should be fairly
straightforward to convert over other boards.

Changes in v2:
- Reduce reserved stack space for board_init_f_mem() to 64 bytes
- Add SYS_MALLOC_F to Kconfig

Simon Glass (15):
  Introduce board_init_f_mem() to handle early memory layout
  powerpc: Permit device tree control of U-Boot (CONFIG_OF_CONTROL)
  powerpc: ppc4xx: canyonlands: config: Tidy up CONFIGs and config.mk
  powerpc: ppc4xx: Move CANYONLANDS/GLACIER/ARCHES to Kconfig
  powerpc: ppc4xx: Add ramboot config for glacier
  powerpc: ppc4xx: canyonlands: Move to generic board
  powerpc: ppc4xx: dts: Bring in canyonlands device tree files
  powerpc: ppc4xx: Call board_init_f_mem() for generic board
  powerpc: ppc4xx: Add a gpio.h header file
  powerpc: ppc4xx: Allow the end of u-boot.bin to be found
  powerpc: ppc4xx: Use CONFIG_OF_CONTROL for canyonlands boards
  ppc: amcc: Omit unneeded ns16550 CONFIG if using driver model
  powerpc: Add serial driver for driver model
  dm: powerpc: ppc4xx: Move glacier to use driver model for serial
  powerpc: Add linkage.h file

Stefan Roese (4):
  WIP: powerpc: ppc4xx: Somehow BSS is not cleared in RAMBOOT case
  powerpc: ppc4xx: Change from OF_SEPARATE to OF_EMBED
  powerpc: ppc4xx: Add defaults for DT based booting to really work
  powerpc: ppc4xx: Enable CONFIG_DISPLAY_BOARDINFO

 arch/Kconfig|   1 +
 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c  |   8 +
 arch/powerpc/cpu/ppc4xx/config.mk   |   5 +-
 arch/powerpc/cpu/ppc4xx/cpu_init.c  |   2 +
 arch/powerpc/cpu/ppc4xx/start.S |  18 +-
 arch/powerpc/cpu/ppc4xx/u-boot.lds  |   8 +-
 arch/powerpc/dts/Makefile   |  11 +
 arch/powerpc/dts/arches.dts | 339 
 arch/powerpc/dts/canyonlands.dts| 561 +++
 arch/powerpc/dts/glacier.dts| 582 
 arch/powerpc/include/asm/arch-ppc4xx/gpio.h |   7 +
 arch/powerpc/include/asm/linkage.h  |   7 +
 arch/powerpc/include/asm/ppc460ex_gt.h  |   2 +
 arch/powerpc/lib/board.c|   3 +
 board/amcc/canyonlands/Kconfig  |  36 ++
 board/amcc/canyonlands/MAINTAINERS  |   1 +
 board/amcc/canyonlands/config.mk|   2 -
 board/amcc/canyonlands/u-boot-ram.lds   |  85 
 common/board_f.c|  18 +
 common/board_r.c|   8 +-
 configs/arches_defconfig|   5 +-
 configs/canyonlands_defconfig   |   5 +-
 configs/glacier_defconfig   |   5 +-
 configs/glacier_ramboot_defconfig   |   8 +
 drivers/serial/Makefile |   1 +
 drivers/serial/serial_ppc.c |  40 ++
 include/configs/amcc-common.h   |   2 +
 include/configs/canyonlands.h   |  38 +-
 28 files changed, 1778 insertions(+), 30 deletions(-)
 create mode 100644 arch/powerpc/dts/Makefile
 create mode 100644 arch/powerpc/dts/arches.dts
 create mode 100644 arch/powerpc/dts/canyonlands.dts
 create mode 100644 arch/powerpc/dts/glacier.dts
 create mode 100644 arch/powerpc/include/asm/arch-ppc4xx/gpio.h
 create mode 100644 arch/powerpc/include/asm/linkage.h
 create mode 100644 board/amcc/canyonlands/u-boot-ram.lds
 create mode 100644 configs/glacier_ramboot_defconfig
 create mode 100644 drivers/serial/serial_ppc.c

-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 05/19] powerpc: ppc4xx: Add ramboot config for glacier

2015-02-07 Thread Simon Glass
Add a new ramboot config for glacier so that it is possible to test U-Boot
loaded over Ethernet instead of using JTAG.

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

Changes in v2: None

 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c |  8 
 board/amcc/canyonlands/MAINTAINERS |  1 +
 board/amcc/canyonlands/u-boot-ram.lds  | 79 ++
 configs/glacier_ramboot_defconfig  |  5 +++
 4 files changed, 93 insertions(+)
 create mode 100644 board/amcc/canyonlands/u-boot-ram.lds
 create mode 100644 configs/glacier_ramboot_defconfig

diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c 
b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
index 71bb9d7..7202c3f 100644
--- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
+++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
@@ -424,6 +424,14 @@ phys_size_t initdram(int board_type)
int write_recovery;
phys_size_t dram_size = 0;
 
+   if (IS_ENABLED(CONFIG_SYS_RAMBOOT)) {
+   /*
+* Reduce RAM size to avoid overwriting memory used by
+* current stack? Not sure what is happening.
+*/
+   return sdram_memsize() / 2;
+   }
+
num_dimm_banks = sizeof(iic0_dimm_addr);
 
/*--
diff --git a/board/amcc/canyonlands/MAINTAINERS 
b/board/amcc/canyonlands/MAINTAINERS
index 52bf004..8be8a52 100644
--- a/board/amcc/canyonlands/MAINTAINERS
+++ b/board/amcc/canyonlands/MAINTAINERS
@@ -6,3 +6,4 @@ F:  include/configs/canyonlands.h
 F: configs/arches_defconfig
 F: configs/canyonlands_defconfig
 F: configs/glacier_defconfig
+F: configs/glacier_ramboot_defconfig
diff --git a/board/amcc/canyonlands/u-boot-ram.lds 
b/board/amcc/canyonlands/u-boot-ram.lds
new file mode 100644
index 000..6765256
--- /dev/null
+++ b/board/amcc/canyonlands/u-boot-ram.lds
@@ -0,0 +1,79 @@
+/*
+ * (C) Copyright 2009
+ * Stefan Roese, DENX Software Engineering, s...@denx.de.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+OUTPUT_ARCH(powerpc)
+SECTIONS
+{
+  /* Read-only sections, merged into text segment: */
+  . = + SIZEOF_HEADERS;
+  .text  :
+  {
+arch/powerpc/cpu/ppc4xx/start.o(.text*)
+board/amcc/canyonlands/init.o  (.text*)
+
+*(.text*)
+  }
+  _etext = .;
+  PROVIDE (etext = .);
+  .rodata:
+  {
+*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+  }
+
+  /* Read-write section, merged into data segment: */
+  . = (. + 0x00FF)  0xFF00;
+  _erotext = .;
+  PROVIDE (erotext = .);
+  .reloc   :
+  {
+KEEP(*(.got))
+_GOT2_TABLE_ = .;
+KEEP(*(.got2))
+_FIXUP_TABLE_ = .;
+KEEP(*(.fixup))
+  }
+  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) 2;
+  __fixup_entries = (. - _FIXUP_TABLE_)2;
+
+  .data:
+  {
+*(.data*)
+*(.sdata*)
+  }
+  _edata  =  .;
+  PROVIDE (edata = .);
+
+  . = .;
+
+  .u_boot_list : {
+   KEEP(*(SORT(.u_boot_list*)));
+  }
+
+  . = .;
+  __start___ex_table = .;
+  __ex_table : { *(__ex_table) }
+  __stop___ex_table = .;
+
+  . = ALIGN(256);
+  __init_begin = .;
+  .text.init : { *(.text.init) }
+  .data.init : { *(.data.init) }
+  . = ALIGN(256);
+  __init_end = .;
+
+  __bss_start = .;
+  .bss (NOLOAD)   :
+  {
+   *(.bss*)
+   *(.sbss*)
+   *(COMMON)
+   . = ALIGN(4);
+  }
+
+  __bss_end = . ;
+  PROVIDE (end = .);
+}
diff --git a/configs/glacier_ramboot_defconfig 
b/configs/glacier_ramboot_defconfig
new file mode 100644
index 000..4fc2303
--- /dev/null
+++ b/configs/glacier_ramboot_defconfig
@@ -0,0 +1,5 @@
+CONFIG_SYS_EXTRA_OPTIONS=SYS_RAMBOOT,SYS_TEXT_BASE=0x0100,SYS_LDSCRIPT=board/amcc/canyonlands/u-boot-ram.lds
+CONFIG_PPC=y
+CONFIG_4xx=y
+CONFIG_TARGET_CANYONLANDS=y
+CONFIG_GLACIER=y
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 18/19] powerpc: ppc4xx: Add defaults for DT based booting to really work

2015-02-07 Thread Simon Glass
From: Stefan Roese s...@denx.de

These additional nodes need to be provided to get U-Boot to boot correctly
on the Canyonlands / Glacier board:

- chosen path to the console-uart
- reg-shift set to 0 in the uart device nodes

Signed-off-by: Stefan Roese s...@denx.de
Cc: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v2: None

 arch/powerpc/dts/canyonlands.dts | 6 ++
 arch/powerpc/dts/glacier.dts | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/arch/powerpc/dts/canyonlands.dts b/arch/powerpc/dts/canyonlands.dts
index 2ec9762..0a2f5d7 100644
--- a/arch/powerpc/dts/canyonlands.dts
+++ b/arch/powerpc/dts/canyonlands.dts
@@ -22,6 +22,10 @@
serial1 = UART1;
};
 
+   chosen {
+   stdout-path = UART0;
+   };
+
cpus {
#address-cells = 1;
#size-cells = 0;
@@ -280,6 +284,7 @@
 
UART0: serial@ef600300 {
device_type = serial;
+   reg-shift = 0;
compatible = ns16550;
reg = 0xef600300 0x0008;
virtual-reg = 0xef600300;
@@ -291,6 +296,7 @@
 
UART1: serial@ef600400 {
device_type = serial;
+   reg-shift = 0;
compatible = ns16550;
reg = 0xef600400 0x0008;
virtual-reg = 0xef600400;
diff --git a/arch/powerpc/dts/glacier.dts b/arch/powerpc/dts/glacier.dts
index 3e7ce2c..bb4e819 100644
--- a/arch/powerpc/dts/glacier.dts
+++ b/arch/powerpc/dts/glacier.dts
@@ -251,6 +251,7 @@
 
UART1: serial@ef600400 {
device_type = serial;
+   reg-shift = 0;
compatible = ns16550;
reg = 0xef600400 0x0008;
virtual-reg = 0xef600400;
@@ -262,6 +263,7 @@
 
UART2: serial@ef600500 {
device_type = serial;
+   reg-shift = 0;
compatible = ns16550;
reg = 0xef600500 0x0008;
virtual-reg = 0xef600500;
@@ -273,6 +275,7 @@
 
UART3: serial@ef600600 {
device_type = serial;
+   reg-shift = 0;
compatible = ns16550;
reg = 0xef600600 0x0008;
virtual-reg = 0xef600600;
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 15/19] dm: powerpc: ppc4xx: Move glacier to use driver model for serial

2015-02-07 Thread Simon Glass
Adjust Kconfig to default to driver model for glacier, canyonlands and
arches.

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

Changes in v2:
- Add SYS_MALLOC_F to Kconfig

 board/amcc/canyonlands/Kconfig | 12 
 1 file changed, 12 insertions(+)

diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig
index 0fc6877..1617d95 100644
--- a/board/amcc/canyonlands/Kconfig
+++ b/board/amcc/canyonlands/Kconfig
@@ -29,4 +29,16 @@ config ARCHES
 
 endchoice
 
+config DM
+   default y
+
+config DM_SERIAL
+   default y
+
+config SYS_MALLOC_F
+   default y
+
+config SYS_MALLOC_F_LEN
+   default 0x400
+
 endif
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 09/19] powerpc: ppc4xx: Call board_init_f_mem() for generic board

2015-02-07 Thread Simon Glass
Call this function to set up our early memory.

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

Changes in v2: None

 arch/powerpc/cpu/ppc4xx/start.S | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index 09a02d7..7a0f0d2 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -760,6 +760,15 @@ _start:
 #endif
 
bl  cpu_init_f  /* run low-level CPU init code (from Flash) 
*/
+#ifdef CONFIG_SYS_GENERIC_BOARD
+   mr  r3, r1
+   bl  board_init_f_mem
+   mr  r1, r3
+   li  r0,0
+   stwur0, -4(r1)
+   stwur0, -4(r1)
+#endif
+   li  r3, 0
bl  board_init_f
/* NOTREACHED - board_init_f() does not return */
 
@@ -1027,7 +1036,14 @@ _start:
GET_GOT /* initialize GOT access
*/
 
bl  cpu_init_f  /* run low-level CPU init code (from Flash) 
*/
-
+#ifdef CONFIG_SYS_GENERIC_BOARD
+   mr  r3, r1
+   bl  board_init_f_mem
+   mr  r1, r3
+   stwur0, -4(r1)
+   stwur0, -4(r1)
+#endif
+   li  r3, 0
bl  board_init_f/* run first part of init code (from Flash) 
*/
/* NOTREACHED - board_init_f() does not return */
 
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 08/19] powerpc: ppc4xx: dts: Bring in canyonlands device tree files

2015-02-07 Thread Simon Glass
The canyonlands.h config file works with canyonlands, glacier and arches
boards. Bring in the device tree files for these from Linux 3.17.

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

Changes in v2: None

 arch/powerpc/dts/Makefile|  11 +
 arch/powerpc/dts/arches.dts  | 339 +++
 arch/powerpc/dts/canyonlands.dts | 555 +
 arch/powerpc/dts/glacier.dts | 579 +++
 4 files changed, 1484 insertions(+)
 create mode 100644 arch/powerpc/dts/Makefile
 create mode 100644 arch/powerpc/dts/arches.dts
 create mode 100644 arch/powerpc/dts/canyonlands.dts
 create mode 100644 arch/powerpc/dts/glacier.dts

diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
new file mode 100644
index 000..ad104b9
--- /dev/null
+++ b/arch/powerpc/dts/Makefile
@@ -0,0 +1,11 @@
+dtb-$(CONFIG_TARGET_CANYONLANDS) += arches.dtb canyonlands.dtb glacier.dtb
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+   @:
+
+clean-files := *.dtb
diff --git a/arch/powerpc/dts/arches.dts b/arch/powerpc/dts/arches.dts
new file mode 100644
index 000..bd5ebfd
--- /dev/null
+++ b/arch/powerpc/dts/arches.dts
@@ -0,0 +1,339 @@
+/*
+ * Device Tree Source for AMCC Arches (dual 460GT board)
+ *
+ * (C) Copyright 2008 Applied Micro Circuits Corporation
+ * Victor Gallardo vgalla...@amcc.com
+ * Adam Graham agra...@amcc.com
+ *
+ * Based on the glacier.dts file
+ *   Stefan Roese s...@denx.de
+ *   Copyright 2008 DENX Software Engineering
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+
+/ {
+   #address-cells = 2;
+   #size-cells = 1;
+   model = amcc,arches;
+   compatible = amcc,arches;
+   dcr-parent = {/cpus/cpu@0};
+
+   aliases {
+   ethernet0 = EMAC0;
+   ethernet1 = EMAC1;
+   ethernet2 = EMAC2;
+   serial0 = UART0;
+   };
+
+   cpus {
+   #address-cells = 1;
+   #size-cells = 0;
+
+   cpu@0 {
+   device_type = cpu;
+   model = PowerPC,460GT;
+   reg = 0x;
+   clock-frequency = 0; /* Filled in by U-Boot */
+   timebase-frequency = 0; /* Filled in by U-Boot */
+   i-cache-line-size = 32;
+   d-cache-line-size = 32;
+   i-cache-size = 32768;
+   d-cache-size = 32768;
+   dcr-controller;
+   dcr-access-method = native;
+   next-level-cache = L2C0;
+   };
+   };
+
+   memory {
+   device_type = memory;
+   reg = 0x 0x 0x; /* Filled in by 
U-Boot */
+   };
+
+   UIC0: interrupt-controller0 {
+   compatible = ibm,uic-460gt,ibm,uic;
+   interrupt-controller;
+   cell-index = 0;
+   dcr-reg = 0x0c0 0x009;
+   #address-cells = 0;
+   #size-cells = 0;
+   #interrupt-cells = 2;
+   };
+
+   UIC1: interrupt-controller1 {
+   compatible = ibm,uic-460gt,ibm,uic;
+   interrupt-controller;
+   cell-index = 1;
+   dcr-reg = 0x0d0 0x009;
+   #address-cells = 0;
+   #size-cells = 0;
+   #interrupt-cells = 2;
+   interrupts = 0x1e 0x4 0x1f 0x4; /* cascade */
+   interrupt-parent = UIC0;
+   };
+
+   UIC2: interrupt-controller2 {
+   compatible = ibm,uic-460gt,ibm,uic;
+   interrupt-controller;
+   cell-index = 2;
+   dcr-reg = 0x0e0 0x009;
+   #address-cells = 0;
+   #size-cells = 0;
+   #interrupt-cells = 2;
+   interrupts = 0xa 0x4 0xb 0x4; /* cascade */
+   interrupt-parent = UIC0;
+   };
+
+   UIC3: interrupt-controller3 {
+   compatible = ibm,uic-460gt,ibm,uic;
+   interrupt-controller;
+   cell-index = 3;
+   dcr-reg = 0x0f0 0x009;
+   #address-cells = 0;
+   #size-cells = 0;
+   #interrupt-cells = 2;
+   interrupts = 0x10 0x4 0x11 0x4; /* cascade */
+   interrupt-parent = UIC0;
+   };
+
+   SDR0: sdr {
+   compatible = ibm,sdr-460gt;
+   dcr-reg = 0x00e 0x002;
+   };
+
+   CPR0: cpr {
+   compatible = ibm,cpr-460gt;
+   dcr-reg = 0x00c 0x002;
+   };
+
+   L2C0: l2c {
+   compatible = ibm,l2-cache-460gt, ibm,l2-cache;
+   dcr-reg = 0x020 0x008  /* Internal SRAM DCR's */
+  0x030 0x008;/* L2 cache DCR's */
+   cache-line-size = 32; /* 32 bytes */
+ 

Re: [U-Boot] [PATCH v2 0/19] powerpc: Introduce device tree control and driver model

2015-02-07 Thread Simon Glass
Hi,

On 7 February 2015 at 11:51, Simon Glass s...@chromium.org wrote:
 This series does a small amount of tweaking to support device tree control
 (CONFIG_OF_CONTROL) on PowerPC platforms. It also adds support for driver
 model. In both cases the main effort is to set things up correctly before
 calling board_init_f().

 A new generic function, board_init_f_mem() is introduced. This does the
 various memory calculations in C code, since they are messy in assembler
 and every architecture should in fact be the same. A later series will
 adjust ARM and x86 to use this function.

 As an example, the Canyonlands boards are converted over to use device tree
 control and driver model for their serial console. It should be fairly
 straightforward to convert over other boards.

 Changes in v2:
 - Reduce reserved stack space for board_init_f_mem() to 64 bytes
 - Add SYS_MALLOC_F to Kconfig

I'm trying to catch up on a few things I haven't got to.

If it suits I can apply this to u-boot-dm since it is a
driver-model-enablement series and Stefan has tested it.

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


[U-Boot] [PATCH v2 10/19] powerpc: ppc4xx: Add a gpio.h header file

2015-02-07 Thread Simon Glass
This is required at present for device tree control. The ppc4xx does support
GPIOs but does not seem to have a proper driver. So this file is empty.

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

Changes in v2: None

 arch/powerpc/include/asm/arch-ppc4xx/gpio.h | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/powerpc/include/asm/arch-ppc4xx/gpio.h

diff --git a/arch/powerpc/include/asm/arch-ppc4xx/gpio.h 
b/arch/powerpc/include/asm/arch-ppc4xx/gpio.h
new file mode 100644
index 000..3d960c3
--- /dev/null
+++ b/arch/powerpc/include/asm/arch-ppc4xx/gpio.h
@@ -0,0 +1,7 @@
+/*
+ * (C) Copyright 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/* This is empty for now as we don't support the generic GPIO interface */
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 06/19] powerpc: ppc4xx: canyonlands: Move to generic board

2015-02-07 Thread Simon Glass
Switch to generic board so that this board will not be broken/removed.

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

Changes in v2: None

 arch/powerpc/cpu/ppc4xx/cpu_init.c | 2 ++
 include/configs/canyonlands.h  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/powerpc/cpu/ppc4xx/cpu_init.c 
b/arch/powerpc/cpu/ppc4xx/cpu_init.c
index e5a0e21..5f5c720 100644
--- a/arch/powerpc/cpu/ppc4xx/cpu_init.c
+++ b/arch/powerpc/cpu/ppc4xx/cpu_init.c
@@ -450,10 +450,12 @@ cpu_init_f (void)
  PLB4Ax_ACR_RDP_4DEEP);
 #endif /* CONFIG_440SP/SPE || CONFIG_460EX/GT || CONFIG_405EX */
 
+#ifndef CONFIG_SYS_GENERIC_BOARD
gd = (gd_t *)(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
 
/* Clear initial global data */
memset((void *)gd, 0, sizeof(gd_t));
+#endif
 }
 
 /*
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index ed790cc..7a1499d 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -13,6 +13,8 @@
 
 #include linux/kconfig.h
 
+#define CONFIG_SYS_GENERIC_BOARD
+
 /*---
  * High Level Configuration Options
  *--*/
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 16/19] powerpc: Add linkage.h file

2015-02-07 Thread Simon Glass
This permits us to use linux/linkage.h on PowerPC machines.

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

Changes in v2: None

 arch/powerpc/include/asm/linkage.h | 7 +++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/powerpc/include/asm/linkage.h

diff --git a/arch/powerpc/include/asm/linkage.h 
b/arch/powerpc/include/asm/linkage.h
new file mode 100644
index 000..559b42e
--- /dev/null
+++ b/arch/powerpc/include/asm/linkage.h
@@ -0,0 +1,7 @@
+/*
+ * Copyright (c) 2014 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/* We don't need anything here at present */
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 19/19] powerpc: ppc4xx: Enable CONFIG_DISPLAY_BOARDINFO

2015-02-07 Thread Simon Glass
From: Stefan Roese s...@denx.de

This also displays the Board: line in the bootup text with the
generic board support code.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v2: None

 board/amcc/canyonlands/Kconfig | 4 
 1 file changed, 4 insertions(+)

diff --git a/board/amcc/canyonlands/Kconfig b/board/amcc/canyonlands/Kconfig
index 1617d95..ba1411c 100644
--- a/board/amcc/canyonlands/Kconfig
+++ b/board/amcc/canyonlands/Kconfig
@@ -29,6 +29,10 @@ config ARCHES
 
 endchoice
 
+config DISPLAY_BOARDINFO
+   bool
+   default y
+
 config DM
default y
 
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 17/19] powerpc: ppc4xx: Change from OF_SEPARATE to OF_EMBED

2015-02-07 Thread Simon Glass
From: Stefan Roese s...@denx.de

This is necessary, as ppc4xx has the reset vector located at the end
of the U-Boot image. This needs to be flashed to the end of the NOR
flash. Adding the dtb to the main U-Boot image will break booting
on ppc4xx. This patch now embeds the dtb in the U-Boot image instead.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Simon Glass s...@chromium.org
Reviewed-by: Simon Glass s...@chromium.org
Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v2: None

 configs/canyonlands_defconfig | 2 +-
 configs/glacier_defconfig | 2 +-
 configs/glacier_ramboot_defconfig | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configs/canyonlands_defconfig b/configs/canyonlands_defconfig
index 6f6cf14..44d4fbd 100644
--- a/configs/canyonlands_defconfig
+++ b/configs/canyonlands_defconfig
@@ -4,4 +4,4 @@ CONFIG_TARGET_CANYONLANDS=y
 CONFIG_CANYONLANDS=y
 CONFIG_DEFAULT_DEVICE_TREE=canyonlands
 CONFIG_OF_CONTROL=y
-CONFIG_OF_SEPARATE=y
+CONFIG_OF_EMBED=y
diff --git a/configs/glacier_defconfig b/configs/glacier_defconfig
index e67fa32..d318f82 100644
--- a/configs/glacier_defconfig
+++ b/configs/glacier_defconfig
@@ -4,4 +4,4 @@ CONFIG_TARGET_CANYONLANDS=y
 CONFIG_GLACIER=y
 CONFIG_DEFAULT_DEVICE_TREE=glacier
 CONFIG_OF_CONTROL=y
-CONFIG_OF_SEPARATE=y
+CONFIG_OF_EMBED=y
diff --git a/configs/glacier_ramboot_defconfig 
b/configs/glacier_ramboot_defconfig
index e5b402e..f8363b2 100644
--- a/configs/glacier_ramboot_defconfig
+++ b/configs/glacier_ramboot_defconfig
@@ -5,4 +5,4 @@ CONFIG_TARGET_CANYONLANDS=y
 CONFIG_GLACIER=y
 CONFIG_DEFAULT_DEVICE_TREE=glacier
 CONFIG_OF_CONTROL=y
-CONFIG_OF_SEPARATE=y
+CONFIG_OF_EMBED=y
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 13/19] ppc: amcc: Omit unneeded ns16550 CONFIG if using driver model

2015-02-07 Thread Simon Glass
This comes from the device tree or a call to get_uart_clock().

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

Changes in v2: None

 arch/powerpc/include/asm/ppc460ex_gt.h | 2 ++
 include/configs/amcc-common.h  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/powerpc/include/asm/ppc460ex_gt.h 
b/arch/powerpc/include/asm/ppc460ex_gt.h
index f41df0d..ea019aa 100644
--- a/arch/powerpc/include/asm/ppc460ex_gt.h
+++ b/arch/powerpc/include/asm/ppc460ex_gt.h
@@ -19,10 +19,12 @@
 /* Memory mapped registers */
 #define CONFIG_SYS_PERIPHERAL_BASE 0xef60 /* Internal Peripherals */
 
+#ifndef CONFIG_DM_SERIAL
 #define CONFIG_SYS_NS16550_COM1(CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
 #define CONFIG_SYS_NS16550_COM2(CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
 #define CONFIG_SYS_NS16550_COM3(CONFIG_SYS_PERIPHERAL_BASE + 0x0500)
 #define CONFIG_SYS_NS16550_COM4(CONFIG_SYS_PERIPHERAL_BASE + 0x0600)
+#endif
 
 #define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00)
 #define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00)
diff --git a/include/configs/amcc-common.h b/include/configs/amcc-common.h
index 2aea899..73e1b0a 100644
--- a/include/configs/amcc-common.h
+++ b/include/configs/amcc-common.h
@@ -20,8 +20,10 @@
  */
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
+#ifndef CONFIG_DM_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE1
 #define CONFIG_SYS_NS16550_CLK get_serial_clock()
+#endif
 #define CONFIG_BAUDRATE115200
 #define CONFIG_SYS_BAUDRATE_TABLE  \
 {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 12/19] powerpc: ppc4xx: Use CONFIG_OF_CONTROL for canyonlands boards

2015-02-07 Thread Simon Glass
Enable CONFIG_OF_CONTROL so that U-Boot on these three boards uses a device
tree for its configuration.

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

Changes in v2: None

 board/amcc/canyonlands/u-boot-ram.lds | 10 --
 configs/arches_defconfig  |  3 +++
 configs/canyonlands_defconfig |  3 +++
 configs/glacier_defconfig |  3 +++
 configs/glacier_ramboot_defconfig |  3 +++
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/board/amcc/canyonlands/u-boot-ram.lds 
b/board/amcc/canyonlands/u-boot-ram.lds
index 6765256..1750c74 100644
--- a/board/amcc/canyonlands/u-boot-ram.lds
+++ b/board/amcc/canyonlands/u-boot-ram.lds
@@ -12,6 +12,7 @@ SECTIONS
   . = + SIZEOF_HEADERS;
   .text  :
   {
+_image_copy_start = .;
 arch/powerpc/cpu/ppc4xx/start.o(.text*)
 board/amcc/canyonlands/init.o  (.text*)
 
@@ -61,9 +62,14 @@ SECTIONS
   . = ALIGN(256);
   __init_begin = .;
   .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
+  .data.init : {
+   *(.data.init)
+   . = ALIGN(256);
+   LONG(0) LONG(0) /* Extend u-boot.bin to here */
+  }
   __init_end = .;
+  _end = .;
+  _image_binary_end = .;
 
   __bss_start = .;
   .bss (NOLOAD)   :
diff --git a/configs/arches_defconfig b/configs/arches_defconfig
index 60e6ef9..30c6932 100644
--- a/configs/arches_defconfig
+++ b/configs/arches_defconfig
@@ -2,3 +2,6 @@ CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
 CONFIG_ARCHES=y
+CONFIG_DEFAULT_DEVICE_TREE=arches
+CONFIG_OF_CONTROL=y
+CONFIG_OF_SEPARATE=y
diff --git a/configs/canyonlands_defconfig b/configs/canyonlands_defconfig
index 37a2b4d..6f6cf14 100644
--- a/configs/canyonlands_defconfig
+++ b/configs/canyonlands_defconfig
@@ -2,3 +2,6 @@ CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
 CONFIG_CANYONLANDS=y
+CONFIG_DEFAULT_DEVICE_TREE=canyonlands
+CONFIG_OF_CONTROL=y
+CONFIG_OF_SEPARATE=y
diff --git a/configs/glacier_defconfig b/configs/glacier_defconfig
index 436b9f8..e67fa32 100644
--- a/configs/glacier_defconfig
+++ b/configs/glacier_defconfig
@@ -2,3 +2,6 @@ CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
 CONFIG_GLACIER=y
+CONFIG_DEFAULT_DEVICE_TREE=glacier
+CONFIG_OF_CONTROL=y
+CONFIG_OF_SEPARATE=y
diff --git a/configs/glacier_ramboot_defconfig 
b/configs/glacier_ramboot_defconfig
index 4fc2303..e5b402e 100644
--- a/configs/glacier_ramboot_defconfig
+++ b/configs/glacier_ramboot_defconfig
@@ -3,3 +3,6 @@ CONFIG_PPC=y
 CONFIG_4xx=y
 CONFIG_TARGET_CANYONLANDS=y
 CONFIG_GLACIER=y
+CONFIG_DEFAULT_DEVICE_TREE=glacier
+CONFIG_OF_CONTROL=y
+CONFIG_OF_SEPARATE=y
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 11/19] powerpc: ppc4xx: Allow the end of u-boot.bin to be found

2015-02-07 Thread Simon Glass
Define an _end symbol indicating the end of u-boot.bin. Also add some dummy
words into the link script to ensure that u-boot.bin will always extend
that far. There may be a better way of doing this.

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

Changes in v2: None

 arch/powerpc/cpu/ppc4xx/u-boot.lds | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/ppc4xx/u-boot.lds 
b/arch/powerpc/cpu/ppc4xx/u-boot.lds
index 8773178..1980508 100644
--- a/arch/powerpc/cpu/ppc4xx/u-boot.lds
+++ b/arch/powerpc/cpu/ppc4xx/u-boot.lds
@@ -76,9 +76,13 @@ SECTIONS
   . = ALIGN(256);
   __init_begin = .;
   .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
+  .data.init : {
+   *(.data.init)
+   . = ALIGN(256);
+   LONG(0) LONG(0) /* Extend u-boot.bin to here */
+  }
   __init_end = .;
+  _end = .;
 
 #ifndef CONFIG_SPL
 #ifdef CONFIG_440
-- 
2.2.0.rc0.207.ga3a616c

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


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Andreas Bießmann
Hi Simon,

On 07.02.15 17:29, Simon Glass wrote:
 On 7 February 2015 at 09:23, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 On 07.02.15 16:10, Simon Glass wrote:
 On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:
 On 06-02-15 22:00, Simon Glass wrote:
 On 6 February 2015 at 13:40, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 On 06.02.15 20:56, Jeroen Hofstee wrote:

 Dynamic list-sections is in general a good thing. But beside the linker
 problem here we will get another problem on darwin hosts when we want to
 read the sections. I added a patch to linux kernel to get around [1].

 So I have another option here:

 4) setup the lists sections in code, add the magic handling for Mach-O
 binaries and remove the linker foo.

 The lower-common-denominator approach is a bit frustrating. How does
 FreeBSD compile U-Boot?


 I guess I am missing the point here. U-boot v2015.01 builds fine
 on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
 which no longer builds mkimage on FreeBSD and Darwin.

 Exactly that is the point. Before it worked to build the host tools on
 some exotic hosts. The introduced linker generated lists breaks this.

 What are you actually using that system for if
 it cannot build U-Boot?

 I am missing the point, u-boot and its tools build fine until v2015.04-rc1
 on FreeBSD and a mac. And this is easily fixed by not using linker magic
 for tools. (and yes sandbox likely fails to build, but I don't care that
 much)

 How do you build U-Boot for any of the boards supported? What I mean
 is that if you can't handle linker scripts in FreeBSD how do you build
 anything beyond the 'tools' build?

 to build U-Boot for any board we use a cross toolchain, to build the
 host tools we use the host compiler. In most cases the cross toolchain
 is gnu/linux which comes with a linker as we know in linux.
 But some host systems toolchain differ. *BSD with ELF as binary format
 is not really a problem here, cause the binary format is comparable. It
 requires just some tweaks for the used host-tools (e.g. host linker) and
 it will work. Unfortunately Darwin uses Mach-O as binary format which
 has some more restrictions. Especially it does not work with sections
 the same way as ELF does. Therefore I posted the patch for
 scripts/mod/file2alias.c in linux kernel to handle these. In days gone
 by we used to support windows as host too, at least with mingw which
 tries to clone a unix environment on windows. But the binary format on
 Windows is still PE (AFAIK) ... I wonder if the MS linker can generate
 those lists.
 
 OK I see, so the GNU cross compilers are used on BSD, but the GNU x86
 compiler is not used for host compiling.
 

 Please do not use the linker to generate those lists. Maybe we should
 use the kernel approach and build the lists inside the code.
 
 Can you point me to that please?

I added correct section handling for Mach-O binary format to the
file2alias.c [1] when they introduced dynamic sections
(ADD_TO_DEVTABLE() macro in that file) which broke compilation on darwin.

 I'm not familiar with it. 

Me too, I just fixed the build when it was broken.

 The kernel
 uses all sorts of crazy link scripts - I wonder how FreeBSD deals with
 that? 

AFAIK there is no link script for any host tool. They use it heavily for
the kernel. But again, this is compiled and linked with the gnu linux
cross tool chain.

 I suppose you can't compile Linux on FreeBSD natively?

This will not work.

Best regards

Andreas Bießmann

[1]
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/mod/file2alias.c?id=bb66fc67192bbd406fe9c22033f1bbbf3e7ec621
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Simon Glass
Hi Andreas,

On 7 February 2015 at 10:08, Andreas Bießmann
andreas.de...@googlemail.com wrote:
 Hi Simon,

 On 07.02.15 17:29, Simon Glass wrote:
 On 7 February 2015 at 09:23, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 On 07.02.15 16:10, Simon Glass wrote:
 On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:
 On 06-02-15 22:00, Simon Glass wrote:
 On 6 February 2015 at 13:40, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 On 06.02.15 20:56, Jeroen Hofstee wrote:

 Dynamic list-sections is in general a good thing. But beside the linker
 problem here we will get another problem on darwin hosts when we want to
 read the sections. I added a patch to linux kernel to get around [1].

 So I have another option here:

 4) setup the lists sections in code, add the magic handling for Mach-O
 binaries and remove the linker foo.

 The lower-common-denominator approach is a bit frustrating. How does
 FreeBSD compile U-Boot?


 I guess I am missing the point here. U-boot v2015.01 builds fine
 on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
 which no longer builds mkimage on FreeBSD and Darwin.

 Exactly that is the point. Before it worked to build the host tools on
 some exotic hosts. The introduced linker generated lists breaks this.

 What are you actually using that system for if
 it cannot build U-Boot?

 I am missing the point, u-boot and its tools build fine until v2015.04-rc1
 on FreeBSD and a mac. And this is easily fixed by not using linker magic
 for tools. (and yes sandbox likely fails to build, but I don't care that
 much)

 How do you build U-Boot for any of the boards supported? What I mean
 is that if you can't handle linker scripts in FreeBSD how do you build
 anything beyond the 'tools' build?

 to build U-Boot for any board we use a cross toolchain, to build the
 host tools we use the host compiler. In most cases the cross toolchain
 is gnu/linux which comes with a linker as we know in linux.
 But some host systems toolchain differ. *BSD with ELF as binary format
 is not really a problem here, cause the binary format is comparable. It
 requires just some tweaks for the used host-tools (e.g. host linker) and
 it will work. Unfortunately Darwin uses Mach-O as binary format which
 has some more restrictions. Especially it does not work with sections
 the same way as ELF does. Therefore I posted the patch for
 scripts/mod/file2alias.c in linux kernel to handle these. In days gone
 by we used to support windows as host too, at least with mingw which
 tries to clone a unix environment on windows. But the binary format on
 Windows is still PE (AFAIK) ... I wonder if the MS linker can generate
 those lists.

 OK I see, so the GNU cross compilers are used on BSD, but the GNU x86
 compiler is not used for host compiling.


 Please do not use the linker to generate those lists. Maybe we should
 use the kernel approach and build the lists inside the code.

 Can you point me to that please?

 I added correct section handling for Mach-O binary format to the
 file2alias.c [1] when they introduced dynamic sections
 (ADD_TO_DEVTABLE() macro in that file) which broke compilation on darwin.

 I'm not familiar with it.

 Me too, I just fixed the build when it was broken.

So are you saying that we need to write a tool which converts the ELF
sections in the u-boot ELF into C code which then gets compiled and
put into a final u-boot ELF? And if we did that then sandbox would
work?

BTW I never did have any success getting a dev environment up on a
Mac. It took hours to download and install things and then I can't
remember what went wrong but it was awful. This was about 2 years ago
- maybe things have got easier? I'm happy to fiddle with this sort of
thing but my pain tolerance isn't what it was/


 The kernel
 uses all sorts of crazy link scripts - I wonder how FreeBSD deals with
 that?

 AFAIK there is no link script for any host tool. They use it heavily for
 the kernel. But again, this is compiled and linked with the gnu linux
 cross tool chain.

Ah OK. And compiling U-Boot sandbox with a gnu linux cross tool chain
(with x86 target) on BSD is not an option? I suppose it would not run.


 I suppose you can't compile Linux on FreeBSD natively?

 This will not work.

 Best regards

 Andreas Bießmann

 [1]
 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/mod/file2alias.c?id=bb66fc67192bbd406fe9c22033f1bbbf3e7ec621

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


[U-Boot] [PATCH v2 1/3] arm: Allow lr to be saved by board code

2015-02-07 Thread Simon Glass
The link register value can be required on some boards (e.g. FEL mode on
sunxi) so use a branch instruction to jump to save_boot_params() instead
of a branch link.

This requires a branch back to save_boot_params_ret so adjust the users
to deal with this. For exynos just drop the function since it doesn't
do anything.

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

Changes in v2:
- Change save_boot_params() to not use lr for return
- Fix up existing save_boot_params() functions for new API

 arch/arm/cpu/armv7/exynos/spl_boot.c   |  1 -
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |  2 +-
 arch/arm/cpu/armv7/omap3/lowlevel_init.S   |  2 +-
 arch/arm/cpu/armv7/start.S |  7 +--
 arch/arm/include/asm/system.h  | 15 +++
 board/nokia/rx51/lowlevel_init.S   |  3 ++-
 6 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/spl_boot.c 
b/arch/arm/cpu/armv7/exynos/spl_boot.c
index bc237c9..c7f943e 100644
--- a/arch/arm/cpu/armv7/exynos/spl_boot.c
+++ b/arch/arm/cpu/armv7/exynos/spl_boot.c
@@ -309,4 +309,3 @@ void board_init_r(gd_t *id, ulong dest_addr)
while (1)
;
 }
-void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S 
b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
index 86c0e42..e19c7ae 100644
--- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
@@ -19,7 +19,7 @@
 ENTRY(save_boot_params)
ldr r1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
str r0, [r1]
-   bx  lr
+   b   save_boot_params_ret
 ENDPROC(save_boot_params)
 
 ENTRY(set_pl310_ctrl_reg)
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S 
b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
index 78577b1..80cb263 100644
--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
@@ -23,7 +23,7 @@ ENTRY(save_boot_params)
ldr r5, [r0, #0x4]
and r5, r5, #0xff
str r5, [r4]
-   bx  lr
+   b   save_boot_params_ret
 ENDPROC(save_boot_params)
 #endif
 
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 70048c1..9b49ece 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -31,9 +31,12 @@
  */
 
.globl  reset
+   .globl  save_boot_params_ret
 
 reset:
-   bl  save_boot_params
+   /* Allow the board to save important registers */
+   b   save_boot_params
+save_boot_params_ret:
/*
 * disable interrupts (FIQ and IRQ), also set the cpu to SVC32 mode,
 * except if in HYP mode already
@@ -96,7 +99,7 @@ ENDPROC(c_runtime_cpu_setup)
  *
  */
 ENTRY(save_boot_params)
-   bx  lr  @ back to my caller
+   b   save_boot_params_ret@ back to my caller
 ENDPROC(save_boot_params)
.weak   save_boot_params
 
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 89f2294..7820486 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -142,6 +142,21 @@ void flush_l3_cache(void);
 
 #ifndef __ASSEMBLY__
 
+/**
+ * save_boot_params() - Save boot parameters before starting reset sequence
+ *
+ * If you provide this function it will be called immediately U-Boot starts,
+ * both for SPL and U-Boot proper.
+ *
+ * All registers are unchanged from U-Boot entry. No registers need be
+ * preserved.
+ *
+ * This is not a normal C function. There is no stack. Return by branching to
+ * save_boot_params_ret.
+ *
+ * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3);
+ */
+
 #define isb() __asm__ __volatile__ ( : : : memory)
 
 #define nop() __asm__ __volatile__(mov\tr0,r0\t@ nop\n\t);
diff --git a/board/nokia/rx51/lowlevel_init.S b/board/nokia/rx51/lowlevel_init.S
index e252909..9d4ea1b 100644
--- a/board/nokia/rx51/lowlevel_init.S
+++ b/board/nokia/rx51/lowlevel_init.S
@@ -37,7 +37,8 @@ ih_magic: /* IH_MAGIC in big endian from 
include/image.h */
 
 .global save_boot_params
 save_boot_params:
-
+   /* Get return address */
+   ldr lr, =save_boot_params_ret
 
 /* Copy valid attached kernel to address KERNEL_ADDRESS */
 
-- 
2.2.0.rc0.207.ga3a616c

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


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Andreas Bießmann
Hi Simon,

On 07.02.15 16:10, Simon Glass wrote:
 On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:
 On 06-02-15 22:00, Simon Glass wrote:
 On 6 February 2015 at 13:40, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 On 06.02.15 20:56, Jeroen Hofstee wrote:

 Dynamic list-sections is in general a good thing. But beside the linker
 problem here we will get another problem on darwin hosts when we want to
 read the sections. I added a patch to linux kernel to get around [1].

 So I have another option here:

 4) setup the lists sections in code, add the magic handling for Mach-O
 binaries and remove the linker foo.

 The lower-common-denominator approach is a bit frustrating. How does
 FreeBSD compile U-Boot?


 I guess I am missing the point here. U-boot v2015.01 builds fine
 on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
 which no longer builds mkimage on FreeBSD and Darwin.

Exactly that is the point. Before it worked to build the host tools on
some exotic hosts. The introduced linker generated lists breaks this.

 What are you actually using that system for if
 it cannot build U-Boot?

 I am missing the point, u-boot and its tools build fine until v2015.04-rc1
 on FreeBSD and a mac. And this is easily fixed by not using linker magic
 for tools. (and yes sandbox likely fails to build, but I don't care that
 much)
 
 How do you build U-Boot for any of the boards supported? What I mean
 is that if you can't handle linker scripts in FreeBSD how do you build
 anything beyond the 'tools' build?

to build U-Boot for any board we use a cross toolchain, to build the
host tools we use the host compiler. In most cases the cross toolchain
is gnu/linux which comes with a linker as we know in linux.
But some host systems toolchain differ. *BSD with ELF as binary format
is not really a problem here, cause the binary format is comparable. It
requires just some tweaks for the used host-tools (e.g. host linker) and
it will work. Unfortunately Darwin uses Mach-O as binary format which
has some more restrictions. Especially it does not work with sections
the same way as ELF does. Therefore I posted the patch for
scripts/mod/file2alias.c in linux kernel to handle these. In days gone
by we used to support windows as host too, at least with mingw which
tries to clone a unix environment on windows. But the binary format on
Windows is still PE (AFAIK) ... I wonder if the MS linker can generate
those lists.

Please do not use the linker to generate those lists. Maybe we should
use the kernel approach and build the lists inside the code.

Best regards

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


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Simon Glass
Hi Andreas,

On 7 February 2015 at 09:23, Andreas Bießmann
andreas.de...@googlemail.com wrote:
 Hi Simon,

 On 07.02.15 16:10, Simon Glass wrote:
 On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:
 On 06-02-15 22:00, Simon Glass wrote:
 On 6 February 2015 at 13:40, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 On 06.02.15 20:56, Jeroen Hofstee wrote:

 Dynamic list-sections is in general a good thing. But beside the linker
 problem here we will get another problem on darwin hosts when we want to
 read the sections. I added a patch to linux kernel to get around [1].

 So I have another option here:

 4) setup the lists sections in code, add the magic handling for Mach-O
 binaries and remove the linker foo.

 The lower-common-denominator approach is a bit frustrating. How does
 FreeBSD compile U-Boot?


 I guess I am missing the point here. U-boot v2015.01 builds fine
 on FreeBSD and as far as I know on a mac as well. It is v2015.04-rc1
 which no longer builds mkimage on FreeBSD and Darwin.

 Exactly that is the point. Before it worked to build the host tools on
 some exotic hosts. The introduced linker generated lists breaks this.

 What are you actually using that system for if
 it cannot build U-Boot?

 I am missing the point, u-boot and its tools build fine until v2015.04-rc1
 on FreeBSD and a mac. And this is easily fixed by not using linker magic
 for tools. (and yes sandbox likely fails to build, but I don't care that
 much)

 How do you build U-Boot for any of the boards supported? What I mean
 is that if you can't handle linker scripts in FreeBSD how do you build
 anything beyond the 'tools' build?

 to build U-Boot for any board we use a cross toolchain, to build the
 host tools we use the host compiler. In most cases the cross toolchain
 is gnu/linux which comes with a linker as we know in linux.
 But some host systems toolchain differ. *BSD with ELF as binary format
 is not really a problem here, cause the binary format is comparable. It
 requires just some tweaks for the used host-tools (e.g. host linker) and
 it will work. Unfortunately Darwin uses Mach-O as binary format which
 has some more restrictions. Especially it does not work with sections
 the same way as ELF does. Therefore I posted the patch for
 scripts/mod/file2alias.c in linux kernel to handle these. In days gone
 by we used to support windows as host too, at least with mingw which
 tries to clone a unix environment on windows. But the binary format on
 Windows is still PE (AFAIK) ... I wonder if the MS linker can generate
 those lists.

OK I see, so the GNU cross compilers are used on BSD, but the GNU x86
compiler is not used for host compiling.


 Please do not use the linker to generate those lists. Maybe we should
 use the kernel approach and build the lists inside the code.

Can you point me to that please? I'm not familiar with it. The kernel
uses all sorts of crazy link scripts - I wonder how FreeBSD deals with
that? I suppose you can't compile Linux on FreeBSD natively?

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


Re: [U-Boot] [PATCHv1 13/22] arm: socfpga: spl: Add s_init

2015-02-07 Thread Simon Glass
Hi,

On 5 February 2015 at 14:16, Dinh Nguyen dingu...@opensource.altera.com wrote:
 On 01/14/2015 05:54 PM, Marek Vasut wrote:
 On Wednesday, January 14, 2015 at 05:40:53 PM, dingu...@opensource.altera.com
 wrote:
 From: Dinh Nguyen dingu...@opensource.altera.com

 s_init will map SDRAM to 0x0.

 Signed-off-by: Dinh Nguyen dingu...@opensource.altera.com

 Hi!

 [...]

 +void s_init(void)
 +{
 +#ifdef CONFIG_SPL_BUILD
 +struct socfpga_system_manager *sysmgr_regs =
 +(struct socfpga_system_manager *)SOCFPGA_SYSMGR_ADDRESS;
 +unsigned long reg;
 +/*
 + * First C code to run. Clear fake OCRAM ECC first as SBE
 + * and DBE might triggered during power on
 + */
 +reg = readl(sysmgr_regs-eccgrp_ocram);
 +if (reg  SYSMGR_ECC_OCRAM_SERR)
 +writel(SYSMGR_ECC_OCRAM_SERR | SYSMGR_ECC_OCRAM_EN,
 +sysmgr_regs-eccgrp_ocram);
 +if (reg  SYSMGR_ECC_OCRAM_DERR)
 +writel(SYSMGR_ECC_OCRAM_DERR  | SYSMGR_ECC_OCRAM_EN,
 +sysmgr_regs-eccgrp_ocram);
 +#else
 +/*
 + * Private components security
 + * U-Boot : configure private timer, global timer and cpu
 + * component access as non secure for kernel stage (as required
 + * by kernel)
 + */
 +setbits_le32(SOCFPGA_SCU_SNSAC, 0xfff);

 We do this in socfpga/misc.c in arch_early_init_r() already. You should
 consolidate this code so we don't have it twice I think.

 Yes, this can be removed.

 +
 +#endif  /* CONFIG_SPL_BUILD */
 +
 +/* Configure the L2 controller to make SDRAM start at 0 */
 +writel(0x1, (SOCFPGA_MPUL2_ADDRESS + SOCFPGA_MPUL2_ADRFLTR_START));

 This as well.


 This call has to stay because we want to map the SDRAM to 0x0 in the
 SPL. The call in arch_early_init_r() is in u-boot, and thus is too late.

Can it be done in SPL's board_init_f()?

See these two patches for background.

http://patchwork.ozlabs.org/patch/432861/
http://patchwork.ozlabs.org/patch/423789/

[snip]

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


[U-Boot] [PATCH v2 2/3] arm: spl: Provide for a board-specific loader

2015-02-07 Thread Simon Glass
Some boards have a special way of loading U-Boot that does not fit with
the existing SPL code. For example sunxi uses an 'FEL' mode where U-Boot
is loaded over USB. Add a CONFIG option and boot mode for this.

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

Changes in v2: None

 arch/arm/include/asm/spl.h | 4 
 common/spl/spl.c   | 5 +
 2 files changed, 9 insertions(+)

diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
index 8acd7cd..17b6f54 100644
--- a/arch/arm/include/asm/spl.h
+++ b/arch/arm/include/asm/spl.h
@@ -26,10 +26,14 @@ enum {
BOOT_DEVICE_SPI,
BOOT_DEVICE_SATA,
BOOT_DEVICE_I2C,
+   BOOT_DEVICE_BOARD,
BOOT_DEVICE_NONE
 };
 #endif
 
+/* Board-specific load method */
+void spl_board_load_image(void);
+
 /* Linker symbols. */
 extern char __bss_start[], __bss_end[];
 
diff --git a/common/spl/spl.c b/common/spl/spl.c
index daaeb50..ded0f30 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -229,6 +229,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
spl_sata_load_image();
break;
 #endif
+#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
+   case BOOT_DEVICE_BOARD:
+   spl_board_load_image();
+   break;
+#endif
default:
 #if defined(CONFIG_SPL_SERIAL_SUPPORT)  defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
puts(SPL: Unsupported Boot Device!\n);
-- 
2.2.0.rc0.207.ga3a616c

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


[U-Boot] [PATCH v2 3/3] sunxi: Normalise FEL support

2015-02-07 Thread Simon Glass
Make sunxi's FEL code fit with the normal U-Boot boot sequence instead of
creating its own. There are some #ifdefs required in start.S. Future work
will hopefully remove these.

This series is available at u-boot-dm, branch sunxi-working.

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

Changes in v2:
- Adjust for new save_boot_params() API
- Drop patch to change r0 to r2 in start.S
- Add #ifdefs to start.S to deal with FEL
- Use 'Fast Early Loader' as the full name for FEL

 arch/arm/cpu/armv7/start.S  |  5 +-
 arch/arm/cpu/armv7/sunxi/Makefile   |  4 +-
 arch/arm/cpu/armv7/sunxi/board.c| 21 
 arch/arm/cpu/armv7/sunxi/config.mk  |  2 -
 arch/arm/cpu/armv7/sunxi/fel_utils.S| 25 +
 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds | 82 -
 arch/arm/include/asm/arch-sunxi/sys_proto.h | 10 
 board/sunxi/Kconfig | 10 
 include/configs/sunxi-common.h  |  6 +--
 scripts/Makefile.spl|  2 -
 10 files changed, 73 insertions(+), 94 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/sunxi/fel_utils.S
 delete mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds

diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 9b49ece..098a83a 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -54,7 +54,8 @@ save_boot_params_ret:
  * (OMAP4 spl TEXT_BASE is not 32 byte aligned.
  * Continue to use ROM code vector only in OMAP4 spl)
  */
-#if !(defined(CONFIG_OMAP44XX)  defined(CONFIG_SPL_BUILD))
+#if !(defined(CONFIG_OMAP44XX)  defined(CONFIG_SPL_BUILD))  \
+   !defined(CONFIG_SPL_FEL)
/* Set V=0 in CP15 SCTLR register - for VBAR to point to vector */
mrc p15, 0, r0, c1, c0, 0   @ Read CP15 SCTLR Register
bic r0, #CR_V   @ V = 0
@@ -67,7 +68,9 @@ save_boot_params_ret:
 
/* the mask ROM code should have PLL and others stable */
 #ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#ifndef CONFIG_SPL_FEL
bl  cpu_init_cp15
+#endif
bl  cpu_init_crit
 #endif
 
diff --git a/arch/arm/cpu/armv7/sunxi/Makefile 
b/arch/arm/cpu/armv7/sunxi/Makefile
index 48db744..c1b975a 100644
--- a/arch/arm/cpu/armv7/sunxi/Makefile
+++ b/arch/arm/cpu/armv7/sunxi/Makefile
@@ -38,7 +38,5 @@ obj-$(CONFIG_MACH_SUN5I)  += dram_sun4i.o
 obj-$(CONFIG_MACH_SUN6I)   += dram_sun6i.o
 obj-$(CONFIG_MACH_SUN7I)   += dram_sun4i.o
 obj-$(CONFIG_MACH_SUN8I)   += dram_sun8i.o
-ifdef CONFIG_SPL_FEL
-obj-y  += start.o
-endif
+obj-y  += fel_utils.o
 endif
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c
index 6e28bcd..b7492ac 100644
--- a/arch/arm/cpu/armv7/sunxi/board.c
+++ b/arch/arm/cpu/armv7/sunxi/board.c
@@ -27,6 +27,13 @@
 
 #include linux/compiler.h
 
+struct fel_stash {
+   uint32_t sp;
+   uint32_t lr;
+};
+
+struct fel_stash fel_stash __attribute__((section(.data)));
+
 static int gpio_init(void)
 {
 #if CONFIG_CONS_INDEX == 1  defined(CONFIG_UART0_PORT_F)
@@ -65,6 +72,12 @@ static int gpio_init(void)
return 0;
 }
 
+void spl_board_load_image(void)
+{
+   debug(Returning to FEL sp=%x, lr=%x\n, fel_stash.sp, fel_stash.lr);
+   return_to_fel(fel_stash.sp, fel_stash.lr);
+}
+
 void s_init(void)
 {
 #if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I
@@ -95,6 +108,14 @@ void s_init(void)
  */
 u32 spl_boot_device(void)
 {
+   /*
+* Have we been asked to return to the FEL portion of the boot ROM?
+* TODO: We need a more robust test here, or bracket this with
+* #ifdef CONFIG_SPL_FEL.
+*/
+   if (fel_stash.lr = 0x  fel_stash.lr  0x4000)
+   return BOOT_DEVICE_BOARD;
+
return BOOT_DEVICE_MMC1;
 }
 
diff --git a/arch/arm/cpu/armv7/sunxi/config.mk 
b/arch/arm/cpu/armv7/sunxi/config.mk
index 00f5ffc..76ffec9 100644
--- a/arch/arm/cpu/armv7/sunxi/config.mk
+++ b/arch/arm/cpu/armv7/sunxi/config.mk
@@ -1,8 +1,6 @@
 # Build a combined spl + u-boot image
 ifdef CONFIG_SPL
 ifndef CONFIG_SPL_BUILD
-ifndef CONFIG_SPL_FEL
 ALL-y += u-boot-sunxi-with-spl.bin
 endif
 endif
-endif
diff --git a/arch/arm/cpu/armv7/sunxi/fel_utils.S 
b/arch/arm/cpu/armv7/sunxi/fel_utils.S
new file mode 100644
index 000..0c1de52
--- /dev/null
+++ b/arch/arm/cpu/armv7/sunxi/fel_utils.S
@@ -0,0 +1,25 @@
+/*
+ * Utility functions for FEL mode.
+ *
+ * Copyright (c) 2015 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include asm-offsets.h
+#include config.h
+#include asm/system.h
+#include linux/linkage.h
+
+ENTRY(save_boot_params)
+   ldr r0, =fel_stash
+   str sp, [r0, #0]
+   str lr, [r0, #4]
+   b   save_boot_params_ret
+ENDPROC(save_boot_params)
+
+ENTRY(return_to_fel)
+   mov sp, r0
+   mov lr, r1
+   bx  lr
+ENDPROC(return_to_fel)
diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds 

Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Jeroen Hofstee

Hello Simon,

On 07-02-15 16:10, Simon Glass wrote:

On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:



I am missing the point, u-boot and its tools build fine until v2015.04-rc1
on FreeBSD and a mac. And this is easily fixed by not using linker magic
for tools. (and yes sandbox likely fails to build, but I don't care that
much)

How do you build U-Boot for any of the boards supported? What I mean
is that if you can't handle linker scripts in FreeBSD how do you build
anything beyond the 'tools' build?


FreeBSD host ld can handle linker scripts fine, it is INSERT BEFORE .data;
which is not supported. Boards don't use the host linker script, but one for
the target, which comes from ports and hence is not that old e.g.

arm-gnueabi-freebsd-ld --version
GNU ld (GNU Binutils) 2.25
Copyright (C) 2014 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later 
version.

This program has absolutely no warranty.

Besides that, boards don't use INSERT before .data, since they have a 
complete

linker script.



The docs for 'ld' seem to indicate that if the -T option is not used
the file is treated as a link script addendum rather than replacing it
entirely. Is that what we want?


FreeBSD ld has this option, it does not work on a MAC/Darwin though
according to Andreas his post. The problem on FreeBSD is the INSERT 
before .data

inside the addendum aka tools/imagetool.lds


Finally, please point me to how I can install FreeBSD in viritualbox
or similar. I'm interested in that...


Just download an install image and start it in virtualbox, see 1.
You might need to change the motherboard type.

doc/README.clang explains how to use the host compiler to cross build
u-boot (for some boards). You can install a gcc cross compiler as well.

[1] https://www.freebsd.org/releases/10.1R/announce.html


I tried this out and I have a prompt but I'm not sure how to install
git or anything else 'pkg install git' tells me there are no packages
available to install matching 'git'. pkg_add seems to be missing. I am
none the wiser after some web searching.


pkg replaced the pkg_add / pkg_info and friends. So it is fine that they
are not there. The weird thing is I just booted 10.1 in virtualbox to 
reproduce
this but works fine (just defaults everywhere), I roughly did [1]. 
Obviously you

need root credentials to install packages, but I doubt you forgot that.

If this still fails, you can always build it from source, but needs a 
bit of patience.

Somthing like this should always work:

portsnap fetch
portsnap extract

cd /usr/ports/devel/git
make config-recursive
make
make install

Let me know if you still have issues.

Regards,
Jeroen


[1] (as root)

pkg install nano git
git clone git://git.denx.de/u-boot.git
git checkout v2015.01 -b b2015.01
cd u-boot
pkg install arm-gnueabi-binutils gmake

gmake CC=clang -target arm-freebsd-eabi -no-integrated-as -mllvm 
-arm-use-movt=0 rpi_defconfig
gmake CROSS_COMPILE=arm-gnueabi-freebsd- CC=clang -target 
arm-freebsd-eabi -no-integrated-as -mllvm -arm-use-movt=0 
-B/usr/local/bin/arm-gnueabi-freebsd- CONFIG_USE_PRIVATE_LIBGCC=y


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


[U-Boot] [RFC PATCH] tools/imagetool: remove linker generated list

2015-02-07 Thread Andreas Bießmann
Commit a93648d197df48fa46dd55f925ff70468bd81c71 introduced linker generated
lists for imagetool which is part of mkimage. It is a nice feature to remove
the annoying register function calls, but is not portable. Unfortunately some
host compilers do not support this type of linker scripts. Therefore this
commit broke this host-tool for theem, namely FreeBSD and Darwin (OS/X).

This commit tries to fix this. We won't go back to the register functions but
we also can not use the linker script. So use another approach copied from
linux kernel scripts/mod/file2alias.c.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
Cc: Guilherme Maciel Ferreira guilherme.maciel.ferre...@gmail.com
---

 tools/Makefile  |2 --
 tools/imagetool.c   |   34 +++
 tools/imagetool.h   |   56 +--
 tools/imagetool.lds |   24 --
 4 files changed, 61 insertions(+), 55 deletions(-)
 delete mode 100644 tools/imagetool.lds

diff --git a/tools/Makefile b/tools/Makefile
index 6e1ce79..ea76a3e 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -124,8 +124,6 @@ HOSTLOADLIBES_dumpimage := $(HOSTLOADLIBES_mkimage)
 HOSTLOADLIBES_fit_info := $(HOSTLOADLIBES_mkimage)
 HOSTLOADLIBES_fit_check_sign := $(HOSTLOADLIBES_mkimage)
 
-HOSTLDFLAGS += -T $(srctree)/tools/imagetool.lds
-
 hostprogs-$(CONFIG_EXYNOS5250) += mkexynosspl
 hostprogs-$(CONFIG_EXYNOS5420) += mkexynosspl
 HOSTCFLAGS_mkexynosspl.o := -pedantic
diff --git a/tools/imagetool.c b/tools/imagetool.c
index 148e466..8563032 100644
--- a/tools/imagetool.c
+++ b/tools/imagetool.c
@@ -12,16 +12,15 @@
 
 struct image_type_params *imagetool_get_type(int type)
 {
-   struct image_type_params *curr;
-   struct image_type_params *start = ll_entry_start(
-   struct image_type_params, image_type);
-   struct image_type_params *end = ll_entry_end(
-   struct image_type_params, image_type);
+   struct image_type_params **curr;
+   INIT_SECTION(image_type);
+   struct image_type_params **start = __start_image_type;
+   struct image_type_params **end = __stop_image_type;
 
for (curr = start; curr != end; curr++) {
-   if (curr-check_image_type) {
-   if (!curr-check_image_type(type))
-   return curr;
+   if ((*curr)-check_image_type) {
+   if (!(*curr)-check_image_type(type))
+   return *curr;
}
}
return NULL;
@@ -34,16 +33,15 @@ int imagetool_verify_print_header(
struct image_tool_params *params)
 {
int retval = -1;
-   struct image_type_params *curr;
+   struct image_type_params **curr;
+   INIT_SECTION(image_type);
 
-   struct image_type_params *start = ll_entry_start(
-   struct image_type_params, image_type);
-   struct image_type_params *end = ll_entry_end(
-   struct image_type_params, image_type);
+   struct image_type_params **start = __start_image_type;
+   struct image_type_params **end = __stop_image_type;
 
for (curr = start; curr != end; curr++) {
-   if (curr-verify_header) {
-   retval = curr-verify_header((unsigned char *)ptr,
+   if ((*curr)-verify_header) {
+   retval = (*curr)-verify_header((unsigned char *)ptr,
 sbuf-st_size, params);
 
if (retval == 0) {
@@ -51,12 +49,12 @@ int imagetool_verify_print_header(
 * Print the image information  if verify is
 * successful
 */
-   if (curr-print_header) {
-   curr-print_header(ptr);
+   if ((*curr)-print_header) {
+   (*curr)-print_header(ptr);
} else {
fprintf(stderr,
%s: print_header undefined for 
%s\n,
-   params-cmdname, curr-name);
+   params-cmdname, (*curr)-name);
}
break;
}
diff --git a/tools/imagetool.h b/tools/imagetool.h
index f35dec7..3e15b4e 100644
--- a/tools/imagetool.h
+++ b/tools/imagetool.h
@@ -20,15 +20,6 @@
 #include unistd.h
 #include u-boot/sha1.h
 
-/* define __KERNEL__ in order to get the definitions
- * required by the linker list. This is probably not
- * the best way to do this */
-#ifndef __KERNEL__
-#define __KERNEL__
-#include linker_lists.h
-#undef __KERNEL__
-#endif /* __KERNEL__ */
-
 #include fdt_host.h
 
 #define ARRAY_SIZE(x)   

[U-Boot] [PATCH] tools: mksunxiboot: Fix problems on big endian systems

2015-02-07 Thread Siarhei Siamashka
Now my PS3 can be also used to build u-boot for sunxi devices.

Signed-off-by: Siarhei Siamashka siarhei.siamas...@gmail.com
---
 tools/mksunxiboot.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/mksunxiboot.c b/tools/mksunxiboot.c
index 1f0fbae..0035f6e 100644
--- a/tools/mksunxiboot.c
+++ b/tools/mksunxiboot.c
@@ -43,19 +43,19 @@ int gen_check_sum(struct boot_file_head *head_p)
uint32_t i;
uint32_t sum;
 
-   length = head_p-length;
+   length = le32_to_cpu(head_p-length);
if ((length  0x3) != 0)/* must 4-byte-aligned */
return -1;
buf = (uint32_t *)head_p;
-   head_p-check_sum = STAMP_VALUE;/* fill stamp */
+   head_p-check_sum = cpu_to_le32(STAMP_VALUE);   /* fill stamp */
loop = length  2;
 
/* calculate the sum */
for (i = 0, sum = 0; i  loop; i++)
-   sum += buf[i];
+   sum += le32_to_cpu(buf[i]);
 
/* write back check sum */
-   head_p-check_sum = sum;
+   head_p-check_sum = cpu_to_le32(sum);
 
return 0;
 }
@@ -125,10 +125,12 @@ int main(int argc, char *argv[])
memcpy(img.header.magic, BOOT0_MAGIC, 8);   /* no '0' termination */
img.header.length =
ALIGN(file_size + sizeof(struct boot_file_head), BLOCK_SIZE);
+   img.header.b_instruction = cpu_to_le32(img.header.b_instruction);
+   img.header.length = cpu_to_le32(img.header.length);
gen_check_sum(img.header);
 
-   count = write(fd_out, img, img.header.length);
-   if (count != img.header.length) {
+   count = write(fd_out, img, le32_to_cpu(img.header.length));
+   if (count != le32_to_cpu(img.header.length)) {
perror(Writing output);
return EXIT_FAILURE;
}
-- 
2.0.5

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


Re: [U-Boot] [U-Boot,v1,4/4] arm, at91, taurus: enable WDT

2015-02-07 Thread Andreas Bießmann
Dear Heiko Schocher,

Heiko Schocher h...@denx.de writes:
enable WDT for the taurus board.

Signed-off-by: Heiko Schocher h...@denx.de
---

 include/configs/taurus.h | 6 ++
 1 file changed, 6 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/3] sunxi: Normalise FEL support

2015-02-07 Thread Siarhei Siamashka
On Sat,  7 Feb 2015 10:47:30 -0700
Simon Glass s...@chromium.org wrote:

 Make sunxi's FEL code fit with the normal U-Boot boot sequence instead of
 creating its own. There are some #ifdefs required in start.S. Future work
 will hopefully remove these.
 
 This series is available at u-boot-dm, branch sunxi-working.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 
 Changes in v2:
 - Adjust for new save_boot_params() API
 - Drop patch to change r0 to r2 in start.S
 - Add #ifdefs to start.S to deal with FEL
 - Use 'Fast Early Loader' as the full name for FEL

Thanks for working on these patches. It looks like we are finally
getting really close to resolving the sunxi FEL boot problem.

Some comments are below.

  arch/arm/cpu/armv7/start.S  |  5 +-
  arch/arm/cpu/armv7/sunxi/Makefile   |  4 +-
  arch/arm/cpu/armv7/sunxi/board.c| 21 
  arch/arm/cpu/armv7/sunxi/config.mk  |  2 -
  arch/arm/cpu/armv7/sunxi/fel_utils.S| 25 +
  arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds | 82 
 -
  arch/arm/include/asm/arch-sunxi/sys_proto.h | 10 
  board/sunxi/Kconfig | 10 
  include/configs/sunxi-common.h  |  6 +--
  scripts/Makefile.spl|  2 -
  10 files changed, 73 insertions(+), 94 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/sunxi/fel_utils.S
  delete mode 100644 arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds
 
 diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
 index 9b49ece..098a83a 100644
 --- a/arch/arm/cpu/armv7/start.S
 +++ b/arch/arm/cpu/armv7/start.S
 @@ -54,7 +54,8 @@ save_boot_params_ret:
   * (OMAP4 spl TEXT_BASE is not 32 byte aligned.
   * Continue to use ROM code vector only in OMAP4 spl)
   */
 -#if !(defined(CONFIG_OMAP44XX)  defined(CONFIG_SPL_BUILD))
 +#if !(defined(CONFIG_OMAP44XX)  defined(CONFIG_SPL_BUILD))  \
 + !defined(CONFIG_SPL_FEL)

Maybe we can just update the 'save_boot_params' function to save the
important configuration registers and then undo this configuration
in 'return_to_fel'? This allows us to avoid the sunxi specific ifdefs
in the core ARM code.

In this particular case, restoring VBAR and CPSR is important because
the BROM code uses an IRQ handler for FEL (presumably USB related).
And we want to ensure that this IRQ handler works properly again
after resuming the FEL code.

   /* Set V=0 in CP15 SCTLR register - for VBAR to point to vector */
   mrc p15, 0, r0, c1, c0, 0   @ Read CP15 SCTLR Register
   bic r0, #CR_V   @ V = 0
 @@ -67,7 +68,9 @@ save_boot_params_ret:
  
   /* the mask ROM code should have PLL and others stable */
  #ifndef CONFIG_SKIP_LOWLEVEL_INIT
 +#ifndef CONFIG_SPL_FEL

Same here.

   bl  cpu_init_cp15
 +#endif
   bl  cpu_init_crit
  #endif
  
 diff --git a/arch/arm/cpu/armv7/sunxi/Makefile 
 b/arch/arm/cpu/armv7/sunxi/Makefile
 index 48db744..c1b975a 100644
 --- a/arch/arm/cpu/armv7/sunxi/Makefile
 +++ b/arch/arm/cpu/armv7/sunxi/Makefile
 @@ -38,7 +38,5 @@ obj-$(CONFIG_MACH_SUN5I)+= dram_sun4i.o
  obj-$(CONFIG_MACH_SUN6I) += dram_sun6i.o
  obj-$(CONFIG_MACH_SUN7I) += dram_sun4i.o
  obj-$(CONFIG_MACH_SUN8I) += dram_sun8i.o
 -ifdef CONFIG_SPL_FEL
 -obj-y+= start.o
 -endif
 +obj-y+= fel_utils.o
  endif
 diff --git a/arch/arm/cpu/armv7/sunxi/board.c 
 b/arch/arm/cpu/armv7/sunxi/board.c
 index 6e28bcd..b7492ac 100644
 --- a/arch/arm/cpu/armv7/sunxi/board.c
 +++ b/arch/arm/cpu/armv7/sunxi/board.c
 @@ -27,6 +27,13 @@
  
  #include linux/compiler.h
  
 +struct fel_stash {
 + uint32_t sp;
 + uint32_t lr;
 +};

struct fel_stash {
uint32_t sp;
uint32_t lr;
uint32_t cpsr;
uint32_t sctlr;
uint32_t vbar;
uint32_t cr;
};

 +struct fel_stash fel_stash __attribute__((section(.data)));
 +
  static int gpio_init(void)
  {
  #if CONFIG_CONS_INDEX == 1  defined(CONFIG_UART0_PORT_F)
 @@ -65,6 +72,12 @@ static int gpio_init(void)
   return 0;
  }
  
 +void spl_board_load_image(void)
 +{
 + debug(Returning to FEL sp=%x, lr=%x\n, fel_stash.sp, fel_stash.lr);
 + return_to_fel(fel_stash.sp, fel_stash.lr);
 +}
 +
  void s_init(void)
  {
  #if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I
 @@ -95,6 +108,14 @@ void s_init(void)
   */
  u32 spl_boot_device(void)
  {
 + /*
 +  * Have we been asked to return to the FEL portion of the boot ROM?
 +  * TODO: We need a more robust test here, or bracket this with
 +  * #ifdef CONFIG_SPL_FEL.
 +  */
 + if (fel_stash.lr = 0x  fel_stash.lr  0x4000)
 + return BOOT_DEVICE_BOARD;
   return BOOT_DEVICE_MMC1;

It is probably better to do it this way:

#ifdef CONFIG_SPL_FEL
return BOOT_DEVICE_BOARD;
#else
if (memcmp((void *)4, eGON.BT0, 8) == 0)
return BOOT_DEVICE_MMC1;
else
return 

Re: [U-Boot] [PATCH v2 2/3] arm: spl: Provide for a board-specific loader

2015-02-07 Thread Siarhei Siamashka
On Sat,  7 Feb 2015 10:47:29 -0700
Simon Glass s...@chromium.org wrote:

 Some boards have a special way of loading U-Boot that does not fit with
 the existing SPL code. For example sunxi uses an 'FEL' mode where U-Boot
 is loaded over USB. Add a CONFIG option and boot mode for this.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 
 Changes in v2: None
 
  arch/arm/include/asm/spl.h | 4 
  common/spl/spl.c   | 5 +
  2 files changed, 9 insertions(+)
 
 diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h
 index 8acd7cd..17b6f54 100644
 --- a/arch/arm/include/asm/spl.h
 +++ b/arch/arm/include/asm/spl.h
 @@ -26,10 +26,14 @@ enum {
   BOOT_DEVICE_SPI,
   BOOT_DEVICE_SATA,
   BOOT_DEVICE_I2C,
 + BOOT_DEVICE_BOARD,
   BOOT_DEVICE_NONE
  };
  #endif
  
 +/* Board-specific load method */
 +void spl_board_load_image(void);
 +
  /* Linker symbols. */
  extern char __bss_start[], __bss_end[];
  
 diff --git a/common/spl/spl.c b/common/spl/spl.c
 index daaeb50..ded0f30 100644
 --- a/common/spl/spl.c
 +++ b/common/spl/spl.c
 @@ -229,6 +229,11 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
   spl_sata_load_image();
   break;
  #endif
 +#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE
 + case BOOT_DEVICE_BOARD:
 + spl_board_load_image();
 + break;
 +#endif
   default:
  #if defined(CONFIG_SPL_SERIAL_SUPPORT)  
 defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
   puts(SPL: Unsupported Boot Device!\n);

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


Re: [U-Boot] [PATCH v2 1/3] arm: Allow lr to be saved by board code

2015-02-07 Thread Siarhei Siamashka
On Sat,  7 Feb 2015 10:47:28 -0700
Simon Glass s...@chromium.org wrote:

 The link register value can be required on some boards (e.g. FEL mode on
 sunxi) so use a branch instruction to jump to save_boot_params() instead
 of a branch link.
 
 This requires a branch back to save_boot_params_ret so adjust the users
 to deal with this. For exynos just drop the function since it doesn't
 do anything.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
 
 Changes in v2:
 - Change save_boot_params() to not use lr for return
 - Fix up existing save_boot_params() functions for new API
 
  arch/arm/cpu/armv7/exynos/spl_boot.c   |  1 -
  arch/arm/cpu/armv7/omap-common/lowlevel_init.S |  2 +-
  arch/arm/cpu/armv7/omap3/lowlevel_init.S   |  2 +-
  arch/arm/cpu/armv7/start.S |  7 +--
  arch/arm/include/asm/system.h  | 15 +++
  board/nokia/rx51/lowlevel_init.S   |  3 ++-
  6 files changed, 24 insertions(+), 6 deletions(-)
 
 diff --git a/arch/arm/cpu/armv7/exynos/spl_boot.c 
 b/arch/arm/cpu/armv7/exynos/spl_boot.c
 index bc237c9..c7f943e 100644
 --- a/arch/arm/cpu/armv7/exynos/spl_boot.c
 +++ b/arch/arm/cpu/armv7/exynos/spl_boot.c
 @@ -309,4 +309,3 @@ void board_init_r(gd_t *id, ulong dest_addr)
   while (1)
   ;
  }
 -void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
 diff --git a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S 
 b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
 index 86c0e42..e19c7ae 100644
 --- a/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
 +++ b/arch/arm/cpu/armv7/omap-common/lowlevel_init.S
 @@ -19,7 +19,7 @@
  ENTRY(save_boot_params)
   ldr r1, =OMAP_SRAM_SCRATCH_BOOT_PARAMS
   str r0, [r1]
 - bx  lr
 + b   save_boot_params_ret
  ENDPROC(save_boot_params)
  
  ENTRY(set_pl310_ctrl_reg)
 diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S 
 b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
 index 78577b1..80cb263 100644
 --- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
 +++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
 @@ -23,7 +23,7 @@ ENTRY(save_boot_params)
   ldr r5, [r0, #0x4]
   and r5, r5, #0xff
   str r5, [r4]
 - bx  lr
 + b   save_boot_params_ret
  ENDPROC(save_boot_params)
  #endif
  
 diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
 index 70048c1..9b49ece 100644
 --- a/arch/arm/cpu/armv7/start.S
 +++ b/arch/arm/cpu/armv7/start.S
 @@ -31,9 +31,12 @@
   */
  
   .globl  reset
 + .globl  save_boot_params_ret
  
  reset:
 - bl  save_boot_params
 + /* Allow the board to save important registers */
 + b   save_boot_params
 +save_boot_params_ret:
   /*
* disable interrupts (FIQ and IRQ), also set the cpu to SVC32 mode,
* except if in HYP mode already
 @@ -96,7 +99,7 @@ ENDPROC(c_runtime_cpu_setup)
   *
   */
  ENTRY(save_boot_params)
 - bx  lr  @ back to my caller
 + b   save_boot_params_ret@ back to my caller
  ENDPROC(save_boot_params)
   .weak   save_boot_params
  
 diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
 index 89f2294..7820486 100644
 --- a/arch/arm/include/asm/system.h
 +++ b/arch/arm/include/asm/system.h
 @@ -142,6 +142,21 @@ void flush_l3_cache(void);
  
  #ifndef __ASSEMBLY__
  
 +/**
 + * save_boot_params() - Save boot parameters before starting reset sequence
 + *
 + * If you provide this function it will be called immediately U-Boot starts,
 + * both for SPL and U-Boot proper.
 + *
 + * All registers are unchanged from U-Boot entry. No registers need be
 + * preserved.
 + *
 + * This is not a normal C function. There is no stack. Return by branching to
 + * save_boot_params_ret.
 + *
 + * void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3);
 + */
 +
  #define isb() __asm__ __volatile__ ( : : : memory)
  
  #define nop() __asm__ __volatile__(mov\tr0,r0\t@ nop\n\t);
 diff --git a/board/nokia/rx51/lowlevel_init.S 
 b/board/nokia/rx51/lowlevel_init.S
 index e252909..9d4ea1b 100644
 --- a/board/nokia/rx51/lowlevel_init.S
 +++ b/board/nokia/rx51/lowlevel_init.S
 @@ -37,7 +37,8 @@ ih_magic:   /* IH_MAGIC in big endian from 
 include/image.h */
  
  .global save_boot_params
  save_boot_params:
 -
 + /* Get return address */
 + ldr lr, =save_boot_params_ret
  
  /* Copy valid attached kernel to address KERNEL_ADDRESS */
  

Acked-by: Siarhei Siamashka siarhei.siamas...@gmail.com

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


Re: [U-Boot] [PATCH 3/3] sunxi: Switch to using soc_init hook for setting the ACTLR.SMP bit

2015-02-07 Thread Ian Campbell
On Wed, 2015-01-21 at 21:03 +0100, Hans de Goede wrote:
 Replace our current DIY solution for setting the Cortex A7 ACTLR.SMP bit
 with using the new soc_init hook and cpu_init_cortex_a7 helper function.
 
 Signed-off-by: Hans de Goede hdego...@redhat.com

Acked-by: Ian Campbell i...@hellion.org.uk


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


Re: [U-Boot] [PATCH v2 3/3] sunxi: Normalise FEL support

2015-02-07 Thread Hans de Goede

Hi,

On 02/07/2015 07:02 PM, Simon Glass wrote:

Hi Hans,

On 7 February 2015 at 10:59, Hans de Goede hdego...@redhat.com wrote:

Hi,

On 02/07/2015 06:47 PM, Simon Glass wrote:


Make sunxi's FEL code fit with the normal U-Boot boot sequence instead of
creating its own. There are some #ifdefs required in start.S. Future work
will hopefully remove these.



About the #ifdefs, I would really like to see us move to having 1 unified
loader for sunxi, which means getting rid of them. Even though we do use
a label to return from save_boot_params, save_boot_params could still
use r0 to return stuff, like you did in your previous patch-set, or we
could add a global variable to start.S which lives in .data and gets
initialized with 0, and save_boot_params could optionally save some
skip flags there.

Note this dropping of #ifdefs can wait till after v2015.04, for now this
patch-set should get fel mode working as before which is the goal for
v2015.04.


OK. It's just as easy for me to do this now, but Albert was not keen
on doing this at run-time.

So if you can remove the #ifdefs by calling back into the BROM that
would probably be better.


Calling back into the BROm, rather then returning into it means that
usb needs to get re-initialized and the usb-host will see a usb
disconnect / reconnect, which is not really pretty, so I would like
to avoid that, and instead use something like your proposed runtime
checking with flags


For now I think Albert prefers the #ifdefs.


#ifdefs are fine for v2015.04, but for v2015.07 I really believe we
need something runtime so that we can move to one unified loader
for sunxi. Albert can you give us some guidance on how we can best
implement runtime checks like the ones which Simon did with flags
stored in r0 in his initial patch-set ?

Regards,

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


Re: [U-Boot] [U-Boot, v2, 01/13] ARM: atmel: clock: make it possible to configure HMX32

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/armv7/at91/clock.c | 8 
 1 file changed, 8 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] u-boot-atmel/master - u-boot/master

2015-02-07 Thread Andreas Bießmann
Hi Tom,

I have some atmel changes posted way before the MW has closed. Sorry for the
delay, there will be some more patches to process next few days.

The following changes since commit 7f641d53bbb3a426a3bfb132d8346153e86a9d08:

  Merge branch 'master' of git://git.denx.de/u-boot-ubi (2015-02-04 13:30:00 
-0500)

are available in the git repository at:


  git://git.denx.de/u-boot-atmel.git master

for you to fetch changes up to 657006a1c46f11784757f9437ffaaa5e0c4dea72:

  arm, at91: taurus remove MACH_TYPE definitions in config file (2015-02-07 
23:43:24 +0100)


Bo Shen (14):
  ARM: atmel: clock: make it possible to configure HMX32
  ARM: atmel: sama5: add bus matrix header file
  ARM: atmel: sama5: add sfr register header file
  ARM: atmel: spl: add weak bus matrix init function
  ARM: atmel: spl: add saic to aic redirect function
  ARM: atmel: spl: can not disable osc for sama5d4
  ARM: atmel: sama5d4: add matrix1 base addr definition
  ARM: atmel: sama5d4: add bus matrix init function
  ARM: atmel: sama5d4: add interrupt redirect function
  ARM: atmel: sama5d4: can access DDR in interleave mode
  ARM: atmel: sama5d4: build related file when enable SPL
  ARM: atmel: sama5d4ek: enable SPL support
  ARM: atmel: sama5d4_xplained: enable spl support
  ARM: atmel: cleanup: remove at91cap9 related code

Heiko Schocher (6):
  arm, at91, wdt: do not disable WDT in SPL
  common/board_f: add at91 wdt
  arm, at91, wdt: make timeout configurable
  arm, at91, taurus: enable WDT
  arm, at91: add reset controller status register
  arm, at91: taurus remove MACH_TYPE definitions in config file

Wu, Josh (5):
  mtd: atmel_nand: according to pmecc version to perform 0xff page 
correction
  ARM: at91: mmc portA support is only for at91sam9g20ek_2mmc board
  ARM: at91: sama5d3_xplained: save environment in a FAT file in MMC card
  ARM: at91: sama5d3xek: save enviroment as a FAT file in MMC card
  ARM: at91: at91sam9x5: save environment to a FAT file in MMC card

 README   |3 +
 arch/arm/Kconfig |2 +
 arch/arm/cpu/arm926ejs/at91/Makefile |1 -
 arch/arm/cpu/arm926ejs/at91/at91cap9_devices.c   |  189 --
 arch/arm/cpu/armv7/at91/clock.c  |8 +
 arch/arm/cpu/armv7/at91/sama5d4_devices.c|   47 ++
 arch/arm/cpu/at91-common/Makefile|1 +
 arch/arm/cpu/at91-common/mpddrc.c|2 +-
 arch/arm/cpu/at91-common/spl.c   |4 +
 arch/arm/cpu/at91-common/spl_atmel.c |   16 ++
 arch/arm/include/asm/arch-at91/at91_common.h |1 +
 arch/arm/include/asm/arch-at91/at91_pmc.h|9 +-
 arch/arm/include/asm/arch-at91/at91_rstc.h   |2 +
 arch/arm/include/asm/arch-at91/at91cap9.h|   78 -
 arch/arm/include/asm/arch-at91/at91cap9_matrix.h |  129 ---
 arch/arm/include/asm/arch-at91/at91sam9_matrix.h |2 -
 arch/arm/include/asm/arch-at91/hardware.h|2 -
 arch/arm/include/asm/arch-at91/sama5_matrix.h|   37 +
 arch/arm/include/asm/arch-at91/sama5_sfr.h   |   38 +
 arch/arm/include/asm/arch-at91/sama5d4.h |2 +
 board/atmel/sama5d4_xplained/sama5d4_xplained.c  |   85 ++
 board/atmel/sama5d4ek/sama5d4ek.c|   85 ++
 common/board_f.c |2 +-
 configs/at91sam9g20ek_2mmc_defconfig |3 +
 configs/at91sam9g20ek_mmc_defconfig  |3 -
 configs/sama5d4_xplained_mmc_defconfig   |1 +
 configs/sama5d4_xplained_nandflash_defconfig |1 +
 configs/sama5d4_xplained_spiflash_defconfig  |1 +
 configs/sama5d4ek_mmc_defconfig  |1 +
 configs/sama5d4ek_nandflash_defconfig|1 +
 configs/sama5d4ek_spiflash_defconfig |1 +
 drivers/mtd/nand/atmel_nand.c|9 ++
 drivers/mtd/nand/atmel_nand_ecc.h|   20 +++
 drivers/video/atmel_lcdfb.c  |2 +-
 drivers/watchdog/at91sam9_wdt.c  |4 +
 include/configs/at91sam9260ek.h  |6 +-
 include/configs/at91sam9x5ek.h   |   11 +-
 include/configs/sama5d3_xplained.h   |9 +-
 include/configs/sama5d3xek.h |   10 +-
 include/configs/sama5d4_xplained.h   |   56 +++
 include/configs/sama5d4ek.h  |   56 +++
 include/configs/taurus.h |9 +-
 42 files changed, 518 insertions(+), 431 deletions(-)
 delete mode 100644 arch/arm/cpu/arm926ejs/at91/at91cap9_devices.c
 delete mode 100644 arch/arm/include/asm/arch-at91/at91cap9.h
 delete mode 100644 arch/arm/include/asm/arch-at91/at91cap9_matrix.h
 create mode 100644 

Re: [U-Boot] [RFC PATCH] tools/imagetool: remove linker generated list

2015-02-07 Thread Jeroen Hofstee

Thanks,

On 02/07/15 22:19, Andreas Bießmann wrote:

Commit a93648d197df48fa46dd55f925ff70468bd81c71 introduced linker generated
lists for imagetool which is part of mkimage. It is a nice feature to remove
the annoying register function calls, but is not portable. Unfortunately some
host compilers do not support this type of linker scripts. Therefore this
commit broke this host-tool for theem, namely FreeBSD and Darwin (OS/X).

This commit tries to fix this. We won't go back to the register functions but
we also can not use the linker script. So use another approach copied from
linux kernel scripts/mod/file2alias.c.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
Cc: Guilherme Maciel Ferreira guilherme.maciel.ferre...@gmail.com



I haven't looked into the details yet, but at least things build
again on FreeBSD with this patch. And tools/mkimage at least
displays a help :)

Thanks again, regards
Jeroen

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


[U-Boot] [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5

2015-02-07 Thread Hans de Goede
Hi Tom,

Here is a patch to fix building u-boot with gcc5 (which has landed in Fedora 
rawhide / F22 recently). Can you please review and merge this ?

Regards,

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


[U-Boot] [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5

2015-02-07 Thread Hans de Goede
Add linux/compiler-gcc5/h from the kernel sources at:

commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b
Author: Steven Noonan ste...@uplinklabs.net
Date:   Sat Oct 25 15:09:42 2014 -0700

compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles

Signed-off-by: Hans de Goede hdego...@redhat.com
---
 include/linux/compiler-gcc5.h | 65 +++
 1 file changed, 65 insertions(+)
 create mode 100644 include/linux/compiler-gcc5.h

diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h
new file mode 100644
index 000..c8c5659
--- /dev/null
+++ b/include/linux/compiler-gcc5.h
@@ -0,0 +1,65 @@
+#ifndef __LINUX_COMPILER_H
+#error Please don't include linux/compiler-gcc5.h directly, include 
linux/compiler.h instead.
+#endif
+
+#define __used __attribute__((__used__))
+#define __must_check   __attribute__((warn_unused_result))
+#define __compiler_offsetof(a, b)  __builtin_offsetof(a, b)
+
+/* Mark functions as cold. gcc will assume any path leading to a call
+   to them will be unlikely.  This means a lot of manual unlikely()s
+   are unnecessary now for any paths leading to the usual suspects
+   like BUG(), printk(), panic() etc. [but let's keep them for now for
+   older compilers]
+
+   Early snapshots of gcc 4.3 don't support this and we can't detect this
+   in the preprocessor, but we can live with this because they're unreleased.
+   Maketime probing would be overkill here.
+
+   gcc also has a __attribute__((__hot__)) to move hot functions into
+   a special section, but I don't see any sense in this right now in
+   the kernel context */
+#define __cold __attribute__((__cold__))
+
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
+
+#ifndef __CHECKER__
+# define __compiletime_warning(message) __attribute__((warning(message)))
+# define __compiletime_error(message) __attribute__((error(message)))
+#endif /* __CHECKER__ */
+
+/*
+ * Mark a position in code as unreachable.  This can be used to
+ * suppress control flow warnings after asm blocks that transfer
+ * control elsewhere.
+ *
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
+ * this in the preprocessor, but we can live with this because they're
+ * unreleased.  Really, we need to have autoconf for the kernel.
+ */
+#define unreachable() __builtin_unreachable()
+
+/* Mark a function definition as prohibited from being cloned. */
+#define __noclone  __attribute__((__noclone__))
+
+/*
+ * Tell the optimizer that something else uses this function or variable.
+ */
+#define __visible __attribute__((externally_visible))
+
+/*
+ * GCC 'asm goto' miscompiles certain code sequences:
+ *
+ *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
+ *
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
+ *
+ * (asm goto is automatically volatile - the naming reflects this.)
+ */
+#define asm_volatile_goto(x...)do { asm goto(x); asm (); } while (0)
+
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
+#define __HAVE_BUILTIN_BSWAP32__
+#define __HAVE_BUILTIN_BSWAP64__
+#define __HAVE_BUILTIN_BSWAP16__
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
-- 
2.2.2

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


Re: [U-Boot] [U-Boot, v3, 2/3] ARM: at91: sama5d3xek: save enviroment as a FAT file in MMC card

2015-02-07 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu josh...@atmel.com writes:
This patch will save U-Boot environment as a file: uboot.env, in FAT partition
instead of in raw sector of MMC card.

This make us easier to manage the environment file.

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Bo Shen voice.s...@atmel.com
---

Changes in v3:
- move CONFIG_FAT_WRITE macro to share with USB and MMC

Changes in v2: None

 include/configs/sama5d3xek.h | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] mtd: atmel_nand: according to pmecc version to perform 0xff page correction

2015-02-07 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu josh...@atmel.com writes:
As the PMECC hardware has different version. In SAMA5D4 chip, the PMECC ip
can generate 0xff pmecc ECC value for all 0xff sector.

According to this, add PMECC version check, if it's SAMA5D4 then we always
let PMECC hardware to correct it.

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Bo Shen voice.s...@atmel.com
Acked-by: Andreas Bießmann andreas.de...@googlemail.com
---

 drivers/mtd/nand/atmel_nand.c |  9 +
 drivers/mtd/nand/atmel_nand_ecc.h | 20 
 2 files changed, 29 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v1,2/4] common/board_f: add at91 wdt

2015-02-07 Thread Andreas Bießmann
Dear Heiko Schocher,

Heiko Schocher h...@denx.de writes:
call hw_watchdog_init() also if CONFIG_AT91SAM9_WATCHDOG
is used.

Signed-off-by: Heiko Schocher h...@denx.de
Reviewed-by: Simon Glass s...@chromium.org
---

 common/board_f.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v3, 3/3] ARM: at91: at91sam9x5: save environment to a FAT file in MMC card

2015-02-07 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu josh...@atmel.com writes:
This patch will save U-Boot environment as a file: uboot.env, in FAT partition
instead of saving it in raw sector of MMC card.

This make us easier to manage the environment file.

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Bo Shen voice.s...@atmel.com
---

Changes in v3: None
Changes in v2:
- refined commit messages
- fix a compile error for at91sam9x5 mmc env file.

 include/configs/at91sam9x5ek.h | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM: at91: mmc portA support is only for at91sam9g20ek_2mmc board

2015-02-07 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu josh...@atmel.com writes:
Current the MMC support will enable MCI port A, Which is only exist
for 2mmc board.
So by default we need to disable MMC (port A) support. And only enable
it for 2mmc board. Otherwise, dataflash won't work in at91sam9260ek board
as MMC has confliction with Dataflash in the CLK pin.

Signed-off-by: Josh Wu josh...@atmel.com
---

 configs/at91sam9g20ek_2mmc_defconfig | 3 +++
 configs/at91sam9g20ek_mmc_defconfig  | 3 ---
 include/configs/at91sam9260ek.h  | 6 --
 3 files changed, 7 insertions(+), 5 deletions(-)
 create mode 100644 configs/at91sam9g20ek_2mmc_defconfig
 delete mode 100644 configs/at91sam9g20ek_mmc_defconfig

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v1,3/4] arm, at91, wdt: make timeout configurable

2015-02-07 Thread Andreas Bießmann
Dear Heiko Schocher,

Heiko Schocher h...@denx.de writes:
make the HW WDT timeout configurable through the define
CONFIG_AT91_HW_WDT_TIMEOUT.

Signed-off-by: Heiko Schocher h...@denx.de
---

 README  | 3 +++
 drivers/watchdog/at91sam9_wdt.c | 4 
 2 files changed, 7 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v1,1/4] arm, at91, wdt: do not disable WDT in SPL

2015-02-07 Thread Andreas Bießmann
Dear Heiko Schocher,

Heiko Schocher h...@denx.de writes:
if CONFIG_AT91SAM9_WATCHDOG is set, do not disable WDT in
SPL

Signed-off-by: Heiko Schocher h...@denx.de
---

 arch/arm/cpu/at91-common/spl.c | 4 
 1 file changed, 4 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v3, 1/3] ARM: at91: sama5d3_xplained: save environment in a FAT file in MMC card

2015-02-07 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu josh...@atmel.com writes:
This patch will save U-Boot environment as a file: uboot.env, in FAT partition
instead of saving it in raw sector of MMC card.

This make us easier to manage the environment file.

Signed-off-by: Josh Wu josh...@atmel.com
Acked-by: Bo Shen voice.s...@atmel.com
---

Changes in v3:
- move CONFIG_FAT_WRITE macro to share with USB and MMC

Changes in v2:
- refined commit messages

 include/configs/sama5d3_xplained.h | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM: atmel: cleanup: remove at91cap9 related code

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
As the at91cap9adk board is removed by commit: b5508344
(ARM: remove broken at91cap9adk board), so the at91cap9
code is not used anymore, and also the document for
at91cap9 can not be found on www.atmel.com, so remove the
at91cap9 related code.

Signed-off-by: Bo Shen voice.s...@atmel.com
Acked-by: Andreas Bießmann andreas.de...@googlemail.com
---

 arch/arm/cpu/arm926ejs/at91/Makefile |   1 -
 arch/arm/cpu/arm926ejs/at91/at91cap9_devices.c   | 189 ---
 arch/arm/include/asm/arch-at91/at91_pmc.h|   9 +-
 arch/arm/include/asm/arch-at91/at91cap9.h|  78 --
 arch/arm/include/asm/arch-at91/at91cap9_matrix.h | 129 
 arch/arm/include/asm/arch-at91/at91sam9_matrix.h |   2 -
 arch/arm/include/asm/arch-at91/hardware.h|   2 -
 drivers/video/atmel_lcdfb.c  |   2 +-
 8 files changed, 4 insertions(+), 408 deletions(-)
 delete mode 100644 arch/arm/cpu/arm926ejs/at91/at91cap9_devices.c
 delete mode 100644 arch/arm/include/asm/arch-at91/at91cap9.h
 delete mode 100644 arch/arm/include/asm/arch-at91/at91cap9_matrix.h

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 10/13] ARM: atmel: sama5d4: can access DDR in interleave mode

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
The SAMAA5D4 SoC can access DDR in interleave mode.

Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/at91-common/mpddrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] arm, at91: add reset controller status register

2015-02-07 Thread Andreas Bießmann
Dear Heiko Schocher,

Heiko Schocher h...@denx.de writes:
add reset controller status register

Signed-off-by: Heiko Schocher h...@denx.de
Acked-by: Bo Shen voice.s...@atmel.com
---

 arch/arm/include/asm/arch-at91/at91_rstc.h | 2 ++
 1 file changed, 2 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] arm, at91: taurus remove MACH_TYPE definitions in config file

2015-02-07 Thread Andreas Bießmann
Dear Heiko Schocher,

Heiko Schocher h...@denx.de writes:
remove MACH_TYPE definitions in config file, as they come from
the defconfig.

Signed-off-by: Heiko Schocher h...@denx.de
---

 include/configs/taurus.h | 3 ---
 1 file changed, 3 deletions(-)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] recent tools on FreeBSD

2015-02-07 Thread Simon Glass
Hi Jeroen,

On 7 February 2015 at 13:17, Jeroen Hofstee jer...@myspectrum.nl wrote:
 Hello Simon,

 On 07-02-15 16:10, Simon Glass wrote:

 On 7 February 2015 at 03:04, Jeroen Hofstee jer...@myspectrum.nl wrote:



 I am missing the point, u-boot and its tools build fine until
 v2015.04-rc1
 on FreeBSD and a mac. And this is easily fixed by not using linker magic
 for tools. (and yes sandbox likely fails to build, but I don't care that
 much)

 How do you build U-Boot for any of the boards supported? What I mean
 is that if you can't handle linker scripts in FreeBSD how do you build
 anything beyond the 'tools' build?


 FreeBSD host ld can handle linker scripts fine, it is INSERT BEFORE .data;
 which is not supported. Boards don't use the host linker script, but one for
 the target, which comes from ports and hence is not that old e.g.

 arm-gnueabi-freebsd-ld --version
 GNU ld (GNU Binutils) 2.25
 Copyright (C) 2014 Free Software Foundation, Inc.
 This program is free software; you may redistribute it under the terms of
 the GNU General Public License version 3 or (at your option) a later
 version.
 This program has absolutely no warranty.

 Besides that, boards don't use INSERT before .data, since they have a
 complete
 linker script.


 The docs for 'ld' seem to indicate that if the -T option is not used
 the file is treated as a link script addendum rather than replacing it
 entirely. Is that what we want?


 FreeBSD ld has this option, it does not work on a MAC/Darwin though
 according to Andreas his post. The problem on FreeBSD is the INSERT before
 .data
 inside the addendum aka tools/imagetool.lds

Do you need INSERT BEFORE or would it just work to specify the .lds
fragment on the ld command line without -T?


 Finally, please point me to how I can install FreeBSD in viritualbox
 or similar. I'm interested in that...


 Just download an install image and start it in virtualbox, see 1.
 You might need to change the motherboard type.

 doc/README.clang explains how to use the host compiler to cross build
 u-boot (for some boards). You can install a gcc cross compiler as well.

 [1] https://www.freebsd.org/releases/10.1R/announce.html

 I tried this out and I have a prompt but I'm not sure how to install
 git or anything else 'pkg install git' tells me there are no packages
 available to install matching 'git'. pkg_add seems to be missing. I am
 none the wiser after some web searching.


 pkg replaced the pkg_add / pkg_info and friends. So it is fine that they
 are not there. The weird thing is I just booted 10.1 in virtualbox to
 reproduce
 this but works fine (just defaults everywhere), I roughly did [1]. Obviously
 you
 need root credentials to install packages, but I doubt you forgot that.

I may as well press on and figure this out.

I tried again and this time it is fine. Last time I tried to install
system documentation and source code, and it tried to install the
package manager but maybe it failed and then put things in a broken
state. Thanks for the help.


 If this still fails, you can always build it from source, but needs a bit of
 patience.
 Somthing like this should always work:

 portsnap fetch
 portsnap extract

 cd /usr/ports/devel/git
 make config-recursive
 make
 make install

 Let me know if you still have issues.

 Regards,
 Jeroen


 [1] (as root)

 pkg install nano git
 git clone git://git.denx.de/u-boot.git
 git checkout v2015.01 -b b2015.01
 cd u-boot
 pkg install arm-gnueabi-binutils gmake

 gmake CC=clang -target arm-freebsd-eabi -no-integrated-as -mllvm
 -arm-use-movt=0 rpi_defconfig
 gmake CROSS_COMPILE=arm-gnueabi-freebsd- CC=clang -target arm-freebsd-eabi
 -no-integrated-as -mllvm -arm-use-movt=0
 -B/usr/local/bin/arm-gnueabi-freebsd- CONFIG_USE_PRIVATE_LIBGCC=y


Is this for using an ARM cross-compiler? What should I do for building
the tools? I keep seeing 'gcc not found'.

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


Re: [U-Boot] [U-Boot,v2,04/13] ARM: atmel: spl: add weak bus matrix init function

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Some SoC need to configure the bus matrix, add an weak function
to be replace by real function.

Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/at91-common/spl_atmel.c | 7 +++
 1 file changed, 7 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 07/13] ARM: atmel: sama5d4: add matrix1 base addr definition

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/include/asm/arch-at91/sama5d4.h | 2 ++
 1 file changed, 2 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,03/13] ARM: atmel: sama5: add sfr register header file

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
The SFR (special function registers) can be shared bwteen
sama5d3 and sama5d4 soc.

Signed-off-by: Bo Shen voice.s...@atmel.com
[whitespace adoptions for 80 char compliance]
Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
---

Changes in v2: None

 arch/arm/include/asm/arch-at91/sama5_sfr.h | 38 ++
 1 file changed, 38 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-at91/sama5_sfr.h

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,06/13] ARM: atmel: spl: can not disable osc for sama5d4

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
The SAMA5D4 SoC on chip rc oscillator can not be disabled.

Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/at91-common/spl_atmel.c | 2 ++
 1 file changed, 2 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,05/13] ARM: atmel: spl: add saic to aic redirect function

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Some SoC need to redirect the saic to aic to make the interrupt to
work, here add a weak function to be replaced by real function.

Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/at91-common/spl_atmel.c | 7 +++
 arch/arm/include/asm/arch-at91/at91_common.h | 1 +
 2 files changed, 8 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,12/13] ARM: atmel: sama5d4ek: enable SPL support

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
The sama5d4ek support boot up from NAND flash, SD/MMC card and
also the SPI flash.

Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2:
- change CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION to 
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION

 arch/arm/Kconfig  |  1 +
 board/atmel/sama5d4ek/sama5d4ek.c | 85 +++
 configs/sama5d4ek_mmc_defconfig   |  1 +
 configs/sama5d4ek_nandflash_defconfig |  1 +
 configs/sama5d4ek_spiflash_defconfig  |  1 +
 include/configs/sama5d4ek.h   | 56 +++
 6 files changed, 145 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 11/13] ARM: atmel: sama5d4: build related file when enable SPL

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/at91-common/Makefile | 1 +
 1 file changed, 1 insertion(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,08/13] ARM: atmel: sama5d4: add bus matrix init function

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2: None

 arch/arm/cpu/armv7/at91/sama5d4_devices.c | 35 +++
 1 file changed, 35 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,02/13] ARM: atmel: sama5: add bus matrix header file

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
This matrix header file can be shared between sama5d3 and sama5d4 soc.

Signed-off-by: Bo Shen voice.s...@atmel.com
[whitespace adaptions for 80 char compliance]
Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
---

Changes in v2: None

 arch/arm/include/asm/arch-at91/sama5_matrix.h | 37 +++
 1 file changed, 37 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-at91/sama5_matrix.h

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2,13/13] ARM: atmel: sama5d4_xplained: enable spl support

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Signed-off-by: Bo Shen voice.s...@atmel.com
---

Changes in v2:
- change CONFIG_SYS_MMC_SD_FS_BOOT_PARTITION to 
CONFIG_SYS_MMCSD_FS_BOOT_PARTITION

 arch/arm/Kconfig|  1 +
 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 85 +
 configs/sama5d4_xplained_mmc_defconfig  |  1 +
 configs/sama5d4_xplained_nandflash_defconfig|  1 +
 configs/sama5d4_xplained_spiflash_defconfig |  1 +
 include/configs/sama5d4_xplained.h  | 56 
 6 files changed, 145 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2, 09/13] ARM: atmel: sama5d4: add interrupt redirect function

2015-02-07 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen voice.s...@atmel.com writes:
Signed-off-by: Bo Shen voice.s...@atmel.com
[fix subject]
Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
---

Changes in v2: None

 arch/arm/cpu/armv7/at91/sama5d4_devices.c | 12 
 1 file changed, 12 insertions(+)

applied to u-boot-atmel/master, thanks!

Best regards,
Andreas Bießmann
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot