Re: [U-Boot] [PATCH v2 1/6] x86: Support machines with >4GB of RAM

2015-03-02 Thread Lukasz Majewski
Hi Simon,

> Some systems have more than 4GB of RAM. U-Boot can only place things
> below 4GB so any memory above that should not be used. Ignore any
> such memory so that the memory size will not exceed the maximum.
> 
> This prevents gd->ram_size exceeding 4GB which causes problems for PCI
> devices which use DMA.
> 
> Signed-off-by: Simon Glass 
> Reviewed-by: Bin Meng 
> ---
> 
> Changes in v2: None
> 
>  arch/x86/cpu/coreboot/sdram.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/cpu/coreboot/sdram.c
> b/arch/x86/cpu/coreboot/sdram.c index e98a230..9c3ab81 100644
> --- a/arch/x86/cpu/coreboot/sdram.c
> +++ b/arch/x86/cpu/coreboot/sdram.c
> @@ -90,7 +90,8 @@ int dram_init(void)
>   struct memrange *memrange = &lib_sysinfo.memrange[i];
>   unsigned long long end = memrange->base +
> memrange->size; 
> - if (memrange->type == CB_MEM_RAM && end > ram_size)
> + if (memrange->type == CB_MEM_RAM && end > ram_size &&
> + memrange->base < (1ULL << 32))
>   ram_size = end;
>   }
>   gd->ram_size = ram_size;
> @@ -108,7 +109,8 @@ void dram_init_banksize(void)
>   for (i = 0, j = 0; i < lib_sysinfo.n_memranges; i++)
> { struct memrange *memrange = &lib_sysinfo.memrange[i];
>  
> - if (memrange->type == CB_MEM_RAM) {
> + if (memrange->type == CB_MEM_RAM &&
> + memrange->base < (1ULL << 32)) {
>   gd->bd->bi_dram[j].start =
> memrange->base; gd->bd->bi_dram[j].size = memrange->size;
>   j++;

Reviewed-by: Lukasz Majewski 

-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/6] sandbox: Implement host dev [device]

2015-03-02 Thread Sjoerd Simons
On Mon, 2015-03-02 at 14:58 -0700, Simon Glass wrote:
> HI Sjoerd,
> 

> How about we change the existing 'sb' command to 'host'? Arguably 'sb'
> is a bit of a silly name. We could maintain an alias for a while.

I'm fine with that. I'll prepare an update patchset doing the alias and
addressing your other comments pn this series. 

Thanks for the feedback!

-- 
Sjoerd Simons 
Collabora Ltd.


smime.p7s
Description: S/MIME cryptographic signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 7/9] ARM: OMAP3: Introduce OMAP3 Cortex-A8 revision specific errata

2015-03-02 Thread Siarhei Siamashka
On Wed, 25 Feb 2015 13:49:52 -0600
Nishanth Menon  wrote:

> On 02/25/2015 05:15 AM, Paul Kocialkowski wrote:
> > Le mardi 24 février 2015 à 16:57 -0600, Nishanth Menon a écrit :
> >> 430973: Stale prediction on replaced inter working branch causes
> >>Cortex-A8 to execute in the wrong ARM/Thumb state
> >> Impacts: Everything lower than r2p1
> >> Work around: Set IBE to 1
> > 
> > According to the Linux kernel source, this should only affect r1p*
> > (hence, not r2p0):
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/mm/proc-v7.S#n321
> 
> I did look at the official Cortex-A8 errata doc (I think this is under
> NDA at least under TI).. Doc revision 20.0

The errata list is not that much secret. But more like all the
documents that you get from your employer are just under NDA by
default. Even though they might be also available from the other
sources.

I had the same problem. And specifically requested and obtained my
own personal copy of the Cortex-A8 errata list from ARM as a private
individual (to my gmail address, and clearly stating that I wanted it
for the purposes *not* related to my corporate job) :-)

I'm not allowed to share my copy with the other people though, so
everyone has to get it directly from ARM. I believe that that this
only requires filling in the registration form on the ARM website
and agreeing with the conditions.

There are also PDF documents from Freescale in public access, which
contain some Cortex-A8 errata information too:

http://cache.freescale.com/files/32bit/doc/errata/IMX50CE.pdf
http://www.freescale.com/docs/pcn_attachments/15760_IMX53CE_Rev4.pdf

-- 
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 V3 0/11] ARM: OMAP3-DRA7: CP15 erratum workarounds and improvements

2015-03-02 Thread Siarhei Siamashka
On Mon, 2 Mar 2015 16:16:08 -0500
Tom Rini  wrote:

> On Thu, Feb 26, 2015 at 06:14:25PM +0200, Siarhei Siamashka wrote:
> > On Thu, 26 Feb 2015 08:50:09 -0600
> > Nishanth Menon  wrote:
> > 
> > > On Thu, Feb 26, 2015 at 1:40 AM, Siarhei Siamashka
> > >  wrote:
> > > > On Wed, 25 Feb 2015 14:55:08 -0600
> > > > Nishanth Menon  wrote:
> > > >
> > > >> Hi,
> > > >>
> > > >> The third incarnation of this series to address various ideas of
> > > >> previous V2 series. I will skip the full blurb and point to V1/V2
> > > >> links for the usual blurb.
> > > >>
> > > >> Changes since V2:
> > > >>   - Added documentation revisioning info with ARM erratums
> > > >>   - patch series are split up to address ARM erratums first 
> > > >> followed by TI
> > > >> OMAP conversion
> > > >>   - More OMAP3 now get erratum implementation - had to redo rx51 a 
> > > >> little
> > > >>   - I think is better helps exynos: 
> > > >> https://patchwork.ozlabs.org/patch/443271/
> > > >>   https://patchwork.ozlabs.org/patch/441863/
> > > >>   - Rearranged the series to address generic ARM first followed by 
> > > >> rest.
> > > >>
> > > >> V2: http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/213060
> > > >> V1: http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/212174
> > > >>
> > > >> Nishanth Menon (10):
> > > >>   ARM: Introduce erratum workaround for 798870
> > > >>   ARM: Introduce erratum workaround for 454179
> > > >>   ARM: Introduce erratum workaround for 430973
> > > >>   ARM: Introduce erratum workaround for 621766
> > > >>   ARM: OMAP: Change set_pl310_ctrl_reg to be generic
> > > >>   ARM: OMAP3: Rename omap3.h to omap.h to be generic as all SoCs
> > > >>   ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with
> > > >> omap_smc1
> > > >>   ARM: OMAP5 / DRA7: Setup L2 Aux Control Register with recommended
> > > >> configuration
> > > >>   ARM: OMAP3: Enable workaround for ARM errata 454179, 430973, 621766
> > > >>   ARM: OMAP3: rx51: Enable workaround for ARM errata 454179, 430973,
> > > >> 621766
> > > >>
> > > >> Praveen Rao (1):
> > > >>   ARM: DRA7 / OMAP5: Add workaround for ARM errata 798870
> > > >
> > > > Could you perhaps also pick up a workaround for "725233: PLD
> > > > instructions executed with PLD data forwarding enabled can result
> > > > in a processor deadlock" for old OMAP3 (r1pX revision of Cortex-A8)?
> > > >
> > > > 
> > > > http://git.denx.de/?p=u-boot.git;a=commitdiff;h=041d42e789aba20296ffcde92173f100a9592880
> > > >
> > > > This used to be in U-Boot earlier, but seems to have vanished from the
> > > > current U-Boot code. I would probably submit a patch myself, but I
> > > > don't have such hardware anymore to test it.
> > > 
> > > Could I have a review by - I think I screwed up r1-r3 handling in
> > > start.S when multiple erratas are enabled - which by some luck, I
> > > have'nt hit.. I should probably fix that.
> > 
> > Sadly, I don't have this old hardware anymore. I have lent my first
> > generation beagleboard to another person several years ago and have no
> > idea where it is now. Maybe I should try to get it back one day :)
> > 
> > But taking the "formal" route, I checked who is the current beagleboard
> > maintainer and looks like that's Tom Rini, who is already quite
> > conveniently in the CC ;-)
> > 
> > Basically, this old hardware is either maintained or not. If it is
> > maintained, then probably the board maintainer is the best person to
> > review and test the errata patches.
> 
> Picking up again, I have original Beagleboards but I need a testcase.
> Is it as simple as "Linux still boots to login on serial and doesn't
> segfault everywhere" ?

In one way, this can be verified by just checking that the necessary
bits in the system registers are properly set according to the
recommendations from the errata lists. AFAIK, only writes to these
registers are restricted, so that it has to be done in an OMAP specific
way using the SMC calls. But reading them somewhere early in the
Linux kernel and doing printk should be fine. I hope that you have
access to your own copy of the Cortex-A8 errata list?

Regarding the testcases and the user visible impact. The IBE workaround
is needed for Thumb2 support. If it is not applied, then branch
prediction is broken and the CPU may end up in a wrong state (ARM vs.
Thumb2). You only need to have two large binaries (which do lots of
branching) running simultaneously, one compiled as ARM code and
another compiled as Thumb2. One of them will eventually die on a
context switch due to SIGILL or SIGSEGV.

One might need to be a little bit careful with the IBE workaround,
because there is a related problem "687067: BTB invalidate by MVA
operations will not work as intended when the IBE bit is enabled"
Which exists in all Cortex-A8 cores regardless of the revision.
However its impact is only limited to "invalidate by MVA operations",
and "invalidate all" operations are no

Re: [U-Boot] [PATCH v5 0/5] Clean out SPL and enable driver model

2015-03-02 Thread Simon Glass
Hi Tom,

On 2 March 2015 at 17:51, Tom Rini  wrote:
> On Mon, Mar 02, 2015 at 03:19:05PM -0700, Simon Glass wrote:
>> Hi,
>>
>> On 26 February 2015 at 10:26, Simon Glass  wrote:
>> > This series includes a few more patches aimed at getting rid of gdata, the
>> > parallel global_data structure introduced on some ARM boards.
>> >
>> > It also collects together the other patches which have been sent 
>> > previously,
>> > so that everything is in one place.
>> >
>> > I would like get this agreed and applied to u-boot-dm this week if possible
>> > so that we will at last have driver model available in SPL.
>> >
>> > This series is available at u-boot-dm/spl-working.
>> >
>> > Changes in v5:
>> > - Rebase to master
>>
>> Are there any more comments on this? I know Albert was looking at
>> applying it, but I am tempted to bring it through the u-boot-dm tree
>> and get it in. RC3 is soon!
>
> Did you have something that switched beaglebone black over to this?
> Thanks!

I think I sent patches at the time but they were too radical. I'm even
nervous about the current set which is why I want time for people to
test this.

I'll dig this up and send a v6.

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


Re: [U-Boot] u-boot tftp problem

2015-03-02 Thread PF4Public

Hello, Joe

Recently I have repeated my tests.
U-Boot logs along with pcap dump could be found here: 
https://mega.co.nz/#!g4UnVaDL!K6ej1OQXg5VE6pU5cmFoELkeqasIDXH1OZbDwdLiXSU


I may be wrong, but after careful examination of these dumps (and older ones), I came to 
the following conclusion:
Somehow lost packets coincide with "--- NetLoop timeout handler set" and "--- NetLoop 
timeout".
Which is supported by these facts: a) both server and u-boot tftp timeouts are equal to 5 
sec; b) whenever I define "#define TIMEOUT 8000UL", even if U-Boot fails to catch the 
first packet, it catches the second one and does not reset it's timer (which seems to 
generate another one ACK for the last received block upon reset); c) similarly if I set 
"tftptimeout 1000", U-Boot still catches the second packet if it could not catch the first 
one. Moreover after yet another examination of windows server session dump I find, this is 
exactly what happens with windows server, which ignores u-boot's request for 5 second 
timeout and resends blocks after 1 second, which are perfectly captured by U-Boot; d) all 
those packets within 5 seconds' timeout got caught by U-Boot.

Please correct me if I'm wrong.
And if I'm not - is there anything to mitigate this, other than "set tftptimeout 1000" and 
"put switch inbetween"? Referring some...@ti.com to this thread maybe?


BTW: putting switch inbetween makes it easier for U-Boot to catch up with tftp 
server.
Compare:
U-Boot > dhcp
BOOTP broadcast 1
DHCP client bound to address 192.168.100.88 (81 ms)
Using DaVinci-EMAC device
TFTP from server 192.168.100.254; our IP address is 192.168.100.88
Filename 'uImage'.
Load address: 0xc070
Loading: ##T T ##T ##
Abort
U-Boot > dhcp
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.100.88 (1074 ms)
Using DaVinci-EMAC device
TFTP from server 192.168.100.254; our IP address is 192.168.100.88
Filename 'uImage'.
Load address: 0xc070
Loading: #T #T T ##T #T T #T #T #T ##T #T ###
Abort
U-Boot > dhcp
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
DHCP client bound to address 192.168.100.88 (4817 ms)
Using DaVinci-EMAC device
TFTP from server 192.168.100.254; our IP address is 192.168.100.88
Filename 'uImage'.
Load address: 0xc070
Loading: #
#
#
 T ##T ###
#
#
 #T
 34.2 KiB/s
done
Bytes transferred = 2225360 (21f4d0 hex)
U-Boot > dhcp
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
DHCP client bound to address 192.168.100.88 (1079 ms)
Using DaVinci-EMAC device
TFTP from server 192.168.100.254; our IP address is 192.168.100.88
Filename 'uImage'.
Load address: 0xc070
Loading: T ###T ##
 T ###T T 
###
#
#
 T #
#
 #T
 32.2 KiB/s
done
Bytes transferred = 2225360 (21f4d0 hex)


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


Re: [U-Boot] [PATCH 13/14] warp: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Otavio Salvador
On Mon, Mar 2, 2015 at 2:14 PM, Fabio Estevam
 wrote:
> Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
> the console and hitting enter afterwards, causes a hang in the system because
> CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
> message:
> "Unknown command '' - try 'help'".
>
> Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
> this problem.
>
> Cc: Otavio Salvador 
> Signed-off-by: Fabio Estevam 

Acked-by: Otavio Salvador 

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 02/14] mx6slevk: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread hui....@freescale.com
> -Original Message-
> From: Fabio Estevam [mailto:fabio.este...@freescale.com]
> Sent: Tuesday, March 03, 2015 1:14 AM
> To: sba...@denx.de
> Cc: u-boot@lists.denx.de; Estevam Fabio-R49496; Liu Hui-R64343
> Subject: [PATCH 02/14] mx6slevk: Use the default CONFIG_SYS_PBSIZE
> 
> Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE
> into the console and hitting enter afterwards, causes a hang in the
> system because CONFIG_SYS_PBSIZE is not capable of storing the extra
> characters of the error
> message:
> "Unknown command '' - try 'help'".
> 
> Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to
> solve this problem.
> 
> Cc: Jason Liu 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx6slevk.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
> index 1221418..21c654b 100644
> --- a/include/configs/mx6slevk.h
> +++ b/include/configs/mx6slevk.h
> @@ -169,8 +169,6 @@
>  #define CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE256
> 
> -/* Print Buffer Size */
> -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)
> + 16)
>  #define CONFIG_SYS_MAXARGS   16
>  #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE


Acked-by: Jason Liu 

> 
> --
> 1.9.1

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


Re: [U-Boot] [PATCH 03/14] mx6qarm2: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread hui....@freescale.com
> -Original Message-
> From: Fabio Estevam [mailto:fabio.este...@freescale.com]
> Sent: Tuesday, March 03, 2015 1:14 AM
> To: sba...@denx.de
> Cc: u-boot@lists.denx.de; Estevam Fabio-R49496; Liu Hui-R64343
> Subject: [PATCH 03/14] mx6qarm2: Use the default CONFIG_SYS_PBSIZE
> 
> Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE
> into the console and hitting enter afterwards, causes a hang in the
> system because CONFIG_SYS_PBSIZE is not capable of storing the extra
> characters of the error
> message:
> "Unknown command '' - try 'help'".
> 
> Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to
> solve this problem.
> 
> Cc: Jason Liu 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx6qarm2.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
> index 76cfef1..5412dd3 100644
> --- a/include/configs/mx6qarm2.h
> +++ b/include/configs/mx6qarm2.h
> @@ -153,8 +153,6 @@
>  #define CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE256
> 
> -/* Print Buffer Size */
> -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)
> + 16)
>  #define CONFIG_SYS_MAXARGS   16
>  #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE

Acked-by: Jason Liu 

> 
> --
> 1.9.1

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


Re: [U-Boot] [PATCH 04/14] mx53loco: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread hui....@freescale.com
> -Original Message-
> From: Fabio Estevam [mailto:fabio.este...@freescale.com]
> Sent: Tuesday, March 03, 2015 1:14 AM
> To: sba...@denx.de
> Cc: u-boot@lists.denx.de; Estevam Fabio-R49496; Liu Hui-R64343
> Subject: [PATCH 04/14] mx53loco: Use the default CONFIG_SYS_PBSIZE
> 
> Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE
> into the console and hitting enter afterwards, causes a hang in the
> system because CONFIG_SYS_PBSIZE is not capable of storing the extra
> characters of the error
> message:
> "Unknown command '' - try 'help'".
> 
> Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to
> solve this problem.
> 
> Cc: Jason Liu 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx53loco.h | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
> index 42bc3c8..3551e02 100644
> --- a/include/configs/mx53loco.h
> +++ b/include/configs/mx53loco.h
> @@ -182,8 +182,6 @@
>  #define CONFIG_AUTO_COMPLETE
>  #define CONFIG_SYS_CBSIZE512 /* Console I/O Buffer Size */
> 
> -/* Print Buffer Size */
> -#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT)
> + 16)
>  #define CONFIG_SYS_MAXARGS   16  /* max number of command args */
>  #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer
> Size */

Acked-by: Jason Liu 

> 
> --
> 1.9.1

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


Re: [U-Boot] [PATCH v5 0/5] Clean out SPL and enable driver model

2015-03-02 Thread Tom Rini
On Mon, Mar 02, 2015 at 03:19:05PM -0700, Simon Glass wrote:
> Hi,
> 
> On 26 February 2015 at 10:26, Simon Glass  wrote:
> > This series includes a few more patches aimed at getting rid of gdata, the
> > parallel global_data structure introduced on some ARM boards.
> >
> > It also collects together the other patches which have been sent previously,
> > so that everything is in one place.
> >
> > I would like get this agreed and applied to u-boot-dm this week if possible
> > so that we will at last have driver model available in SPL.
> >
> > This series is available at u-boot-dm/spl-working.
> >
> > Changes in v5:
> > - Rebase to master
> 
> Are there any more comments on this? I know Albert was looking at
> applying it, but I am tempted to bring it through the u-boot-dm tree
> and get it in. RC3 is soon!

Did you have something that switched beaglebone black over to this?
Thanks!

-- 
Tom


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


[U-Boot] [PATCH] Kconfig: Move CONFIG_BOOTSTAGE to Kconfig

2015-03-02 Thread Simon Glass
Move CONFIG_BOOT_STAGE and its associated options to Kconfig. Adjust
existing users and code.

Signed-off-by: Simon Glass 
---

 README   |  49 
 arch/x86/Kconfig |   9 
 arch/x86/cpu/cpu.c   |   2 +-
 common/Kconfig   | 106 +++
 common/cmd_bootstage.c   |   7 +--
 configs/sandbox_defconfig|   1 +
 include/bootstage.h  |   2 +-
 include/configs/sandbox.h|   1 -
 include/configs/x86-common.h |   3 --
 9 files changed, 119 insertions(+), 61 deletions(-)

diff --git a/README b/README
index febefb5..4848e13 100644
--- a/README
+++ b/README
@@ -3228,55 +3228,6 @@ CBFS (Coreboot Filesystem) support
example, some LED's) on your board. At the moment,
the following checkpoints are implemented:
 
-- Detailed boot stage timing
-   CONFIG_BOOTSTAGE
-   Define this option to get detailed timing of each stage
-   of the boot process.
-
-   CONFIG_BOOTSTAGE_USER_COUNT
-   This is the number of available user bootstage records.
-   Each time you call bootstage_mark(BOOTSTAGE_ID_ALLOC, ...)
-   a new ID will be allocated from this stash. If you exceed
-   the limit, recording will stop.
-
-   CONFIG_BOOTSTAGE_REPORT
-   Define this to print a report before boot, similar to this:
-
-   Timer summary in microseconds:
-  MarkElapsed  Stage
- 0  0  reset
- 3,575,678  3,575,678  board_init_f start
- 3,575,695 17  arch_cpu_init A9
- 3,575,777 82  arch_cpu_init done
- 3,659,598 83,821  board_init_r start
- 3,910,375250,777  main_loop
-29,916,167 26,005,792  bootm_start
-30,361,327445,160  start_kernel
-
-   CONFIG_CMD_BOOTSTAGE
-   Add a 'bootstage' command which supports printing a report
-   and un/stashing of bootstage data.
-
-   CONFIG_BOOTSTAGE_FDT
-   Stash the bootstage information in the FDT. A root 'bootstage'
-   node is created with each bootstage id as a child. Each child
-   has a 'name' property and either 'mark' containing the
-   mark time in microsecond, or 'accum' containing the
-   accumulated time for that bootstage id in microseconds.
-   For example:
-
-   bootstage {
-   154 {
-   name = "board_init_f";
-   mark = <3575678>;
-   };
-   170 {
-   name = "lcd";
-   accum = <33482>;
-   };
-   };
-
-   Code in the Linux kernel can find this in /proc/devicetree.
 
 Legacy uImage format:
 
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 35d24e4..78a0532 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -455,4 +455,13 @@ config PCIE_ECAM_BASE
  assigned to PCI devices - i.e. the memory and prefetch regions, as
  passed to pci_set_region().
 
+config BOOTSTAGE
+   default y
+
+config BOOTSTAGE_REPORT
+   default y
+
+config CMD_BOOTSTAGE
+   default y
+
 endmenu
diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index ed7905c..a9ca50b 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -163,7 +163,7 @@ void setup_gdt(gd_t *id, u64 *gdt_addr)
 int __weak x86_cleanup_before_linux(void)
 {
 #ifdef CONFIG_BOOTSTAGE_STASH
-   bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH,
+   bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
CONFIG_BOOTSTAGE_STASH_SIZE);
 #endif
 
diff --git a/common/Kconfig b/common/Kconfig
index f82bc88..7a44272 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -335,4 +335,110 @@ config CMD_SETGETDCR
 
 endmenu
 
+menu "Boot timing"
+
+config BOOTSTAGE
+   bool "Boot timing and reporting"
+   help
+ Enable recording of boot time while booting. To use it, insert
+ calls to bootstage_mark() with a suitable BOOTSTAGE_ID from
+ bootstage.h. Only a single entry is recorded for each ID. You can
+ give the entry a name with bootstage_mark_name(). You can also
+ record elapsed time in a particular stage using bootstage_start()
+ before starting and bootstage_accum() when finished. Bootstage will
+ add up all the accumated time and report it.
+
+ Normally, IDs are defined in bootstage.h but a small number of
+ additional 'user' IDs can be used but passing BOOTSTAGE_ID_ALLOC
+ as the ID.
+
+ Calls to show_boot_progress() wil also result in log entries but
+ these will not have names.
+
+confi

[U-Boot] [PATCH] buildman: Correct toolchain download feature

2015-03-02 Thread Simon Glass
Commit d908898 updated the ScanPath() function but not its documentation
and not all its callers.

This breaks the toolchain check after it is downloaded. Fix it.

Signed-off-by: Simon Glass 
---

 tools/buildman/toolchain.py | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index 537797a..051da11 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -465,11 +465,15 @@ class Toolchains:
 # Check that the toolchain works
 print 'Testing'
 dirpath = os.path.join(dest, path)
-compiler_fname = self.ScanPath(dirpath, True)
-if not compiler_fname:
+compiler_fname_list = self.ScanPath(dirpath, True)
+if not compiler_fname_list:
 print 'Could not locate C compiler - fetch failed.'
 return 1
-toolchain = Toolchain(compiler_fname, True, True)
+if len(compiler_fname_list) != 1:
+print ('Internal error, ambiguous toolchains: %s' %
+   (', '.join(compiler_fname)))
+return 1
+toolchain = Toolchain(compiler_fname_list[0], True, True)
 
 # Make sure that it will be found by buildman
 if not self.TestSettingsHasPath(dirpath):
-- 
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] DWC2 driver issues

2015-03-02 Thread Stephen Warren

On 03/02/2015 04:42 AM, Marek Vasut wrote:

On Saturday, February 28, 2015 at 05:33:31 AM, Stephen Warren wrote:

On 02/19/2015 07:29 AM, Marek Vasut wrote:

On Monday, February 16, 2015 at 07:28:45 PM, Stephen Warren wrote:

Following on from my Google+ post about DWC2/RPi USB host controller
issues in U-Boot.


...


On an RPi with the DWC2 controller connected directly to a single
external USB connector (i.e model A, A+), a LS (and perhaps FS) device
pluged directly into the board doesn't work due to the small max packet
size limit.

Your patch 9b1161af8c51 "usb: dwc2: Add support for multi-packet control
xfers" in u-boot-usb.git topic/dwc2 addresses this issue for control
transfers at least. With your patch, I can now enumerate a USB kbd on a
model A+. That's a great improvement; thanks for the quick response with
a patch.

However, when I enable CONFIG_USB_KEYBOARD, I see errors when the USB

keyboard input driver initializes:

starting USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 3 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found
scanning usb for ethernet devices... 0 Ethernet Device(s) found

dev = 0df92ac0 pipe = 0x40408380 buf = 0db4a780 size = 8 int = 10
Failed to get keyboard state from device 413c:2010


I haven't investigated this further yet.


Wow, this error is new, I have not seen this one on SoCFPGA.


This error is because the keyboard driver uses interrupt transfers, and
these aren't implemented in DWC2.


Uh, the debugging spit in submit_int_msg() should certainly be converted
into something more human readable.


I worked around this by forcing the
keyboard driver to use control transfers, and fixing what I think is a
bug in this case; see patch below. With this, USB keyboard works on an
RPI A+


Cool, good job.


although it hangs pretty quickly. I assume one of the busy loops
in dwc2.c without a time out isn't completing.


Oh, dang. Those should certainly be fixed.

Looking at the patch, could it be that CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
support in usb_kbd.c is broken altogether ?


Well, once I applied that patch I did manage to type a few characters 
into the U-Boot shell via usbkbd one of the two times I tested, so it's 
not *completely* broken. It's still possible it's quite broken though, 
given the hangs:-)

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


Re: [U-Boot] [PATCH v5 0/5] Clean out SPL and enable driver model

2015-03-02 Thread Simon Glass
Hi,

On 26 February 2015 at 10:26, Simon Glass  wrote:
> This series includes a few more patches aimed at getting rid of gdata, the
> parallel global_data structure introduced on some ARM boards.
>
> It also collects together the other patches which have been sent previously,
> so that everything is in one place.
>
> I would like get this agreed and applied to u-boot-dm this week if possible
> so that we will at last have driver model available in SPL.
>
> This series is available at u-boot-dm/spl-working.
>
> Changes in v5:
> - Rebase to master

Are there any more comments on this? I know Albert was looking at
applying it, but I am tempted to bring it through the u-boot-dm tree
and get it in. RC3 is soon!

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


Re: [U-Boot] [RFC PATCH v4 23/23] sandbox: eth: Add support for using the 'lo' interface

2015-03-02 Thread Simon Glass
Hi Joe,

On 2 March 2015 at 00:18, Joe Hershberger  wrote:
>
>
> On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass  wrote:
>>
>> Hi Joe,
>>
>> On 24 February 2015 at 17:02, Joe Hershberger 
>> wrote:
>> > The 'lo' interface on Linux doesn't support thinks like ARP or
>> > link-layer access like we use to talk to a normal network interface.
>> > A higher-level network API must be used to access localhost.
>> >
>> > As written, this interface is limited to not supporting ICMP since the
>> > API doesn't allow the socket to be opened for all IP traffic and be able
>> > to receive at the same time. UDP is far more useful to test with, so it
>> > was selected over ICMP. Ping won't work, but things like TFTP should
>> > work.
>> >
>> > Signed-off-by: Joe Hershberger 
>> >
>> > ---
>> >
>> > Changes in v4:
>> > -Added support for the 'lo' network interface
>> >
>> > Changes in v3: None
>> > Changes in v2: None
>> >
>> >  arch/sandbox/cpu/eth-raw-os.c | 152
>> > +++---
>> >  arch/sandbox/dts/sandbox.dts  |  10 +++
>> >  arch/sandbox/include/asm/eth-raw-os.h |  10 ++-
>> >  drivers/net/sandbox-raw.c |  62 +-
>> >  4 files changed, 203 insertions(+), 31 deletions(-)
>> >
>> > diff --git a/arch/sandbox/cpu/eth-raw-os.c
>> > b/arch/sandbox/cpu/eth-raw-os.c
>> > index 9218f94..acb150a 100644
>> > --- a/arch/sandbox/cpu/eth-raw-os.c
>> > +++ b/arch/sandbox/cpu/eth-raw-os.c
>> > @@ -11,6 +11,8 @@
>> >  #include 
>> >  #include 
>> >  #include 
>> > +#include 
>> > +#include 
>> >  #include 
>> >  #include 
>> >  #include 
>> > @@ -19,51 +21,139 @@
>> >  #include 
>> >  #include 
>> >
>> > +#include 
>> >  #include 
>> >  #include 
>> >
>> >  int sandbox_eth_raw_os_init(const char *ifname, unsigned char *ethmac,
>> > struct eth_sandbox_raw_priv *priv)
>> >  {
>> > -   struct sockaddr_ll *device;
>> > -   struct packet_mreq mr;
>> > -
>> > -   /* Prepare device struct */
>> > -   priv->device = malloc(sizeof(struct sockaddr_ll));
>> > -   device = priv->device;
>> > -   memset(device, 0, sizeof(struct sockaddr_ll));
>> > -   device->sll_ifindex = if_nametoindex(ifname);
>> > -   device->sll_family = AF_PACKET;
>> > -   memcpy(device->sll_addr, ethmac, 6);
>> > -   device->sll_halen = htons(6);
>> > -
>> > -   /* Open socket */
>> > -   priv->sd = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
>> > -   if (priv->sd < 0) {
>> > -   printf("Failed to open socket: %d %s\n", errno,
>> > -  strerror(errno));
>> > -   return -errno;
>> > +   if (priv->local) {
>>
>> Can you put these two blocks of code (if and else) in separate
>> functions and call them from here? This function is too long.
>
> OK
>
>> > +   struct sockaddr_in *device;
>> > +   int ret;
>> > +   struct timeval tv;
>> > +   int one = 1;
>> > +
>> > +   /* Prepare device struct */
>> > +   priv->device = malloc(sizeof(struct sockaddr_in));
>>
>> return -ENOMEM if NULL.
>>
>> > +   device = priv->device;
>> > +   memset(device, 0, sizeof(struct sockaddr_in));
>> > +   device->sin_family = AF_INET;
>> > +   ret = inet_pton(AF_INET, "127.0.0.1",
>>
>> Is this INADDR_LOOPBACK? Maybe you can just assign it here?
>>
>> > + (struct in_addr *)&device->sin_addr.s_addr);
>> > +   if (ret < 0) {
>> > +   printf("Failed to convert address: %d %s\n",
>> > errno,
>> > +  strerror(errno));
>> > +   return -errno;
>> > +   }
>> > +
>> > +   /**
>> > +* Open socket
>> > +*  Since we specify UDP here, any incoming ICMP packets
>> > will
>> > +*  not be received, so things like ping will not work
>> > on this
>> > +*  localhost interface.
>> > +*/
>> > +   priv->sd = socket(AF_INET, SOCK_RAW, IPPROTO_UDP);
>> > +   if (priv->sd < 0) {
>> > +   printf("Failed to open socket: %d %s\n", errno,
>> > +  strerror(errno));
>> > +   return -errno;
>> > +   }
>> > +
>> > +   /* Allow the receive to timeout after a millisecond */
>> > +   tv.tv_sec = 0;
>> > +   tv.tv_usec = 1000;
>> > +   ret = setsockopt(priv->sd, SOL_SOCKET, SO_RCVTIMEO,
>> > (char *)&tv,
>> > +  sizeof(struct timeval));
>> > +   if (ret < 0) {
>> > +   printf("Failed to set opt: %d %s\n", errno,
>> > +  strerror(errno));
>> > +   return -errno;
>> > +   }
>> > +
>> > +   /* Include the UDP/IP headers on send and receive */
>> > +  

Re: [U-Boot] [RFC PATCH 01/13] Use 'U-Boot' instead of 'U-boot' in CONFIG_BOOTP_VCI_STRING

2015-03-02 Thread Simon Glass
Hi Tom,

On 2 March 2015 at 06:59, Tom Rini  wrote:
> On Sun, Mar 01, 2015 at 09:33:27AM -0700, Simon Glass wrote:
>
>> This string seems wrong - U-Boot is normally written with a capital B.
>>
>> Signed-off-by: Simon Glass 
>
> But it's in the wild and thus in various dhcpd config files such as:
> ...
> } elsif substring (option vendor-class-identifier, 0, 17) = "AM335x U-Boot 
> SPL" {
>   filename "am335x/u-boot.img";
> ...
>
> in mine for am335x.  So "U-boot" exists in other peoples file and thus
> we can't really go off and change it.  NAK, sorry.

OK, I wondered if someone was going to say that. It's a shame it isn't
case-insensitive!

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


Re: [U-Boot] lcd-console / display rotation

2015-03-02 Thread Anatolij Gustschin
Hi,

On Mon, 2 Mar 2015 11:12:23 +0100
Hannes Petermaier  wrote:

> Hello everybody,
> 
> A short question about lcd-console:
> 
> Today u-boot only supports a 'linear framebuffer', meaning the next pixel 
> of a character is allways right after left and the framebuffer address is 
> incrementing.
> We call this the display is mounted with 0° rotation.
> 
> In some cases we have a rotated display.
> Maybe rotated by 90° to have portrait mode or even 180° due to mechanical 
> issues.
> 
> My question is:
> Is anybody currently working around this, having rotated display ?

not that I am aware of.

Best regards,

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


Re: [U-Boot] [PATCH 3/6] sandbox: Implement host dev [device]

2015-03-02 Thread Simon Glass
HI Sjoerd,

On 28 February 2015 at 07:00, Sjoerd Simons
 wrote:
> On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote:
>> Hi Sjoerd,
>>
>> On 19 February 2015 at 15:41, Sjoerd Simons
>>  wrote:
>> > A common pattern to check if a certain device exists (e.g. in
>> > config_distro_bootcmd) is to use:  dev [device]
>> >
>> > Implement host dev [device] so this pattern can be used for sandbox host
>> > devices.
>>
>> I don't see where this actually affects anything? In other words, does
>> it really use the device you select, or just ignore you?
>
> It gets ignored, it's only real usage is to detect whether a device
> exists.
>
> To step back the reason I implemented it here is just to make it simpler
> to integrate with the command boot commands as it's common blockdevice
> macro is:
>
> #define BOOTENV_SHARED_BLKDEV_BODY(devtypel) \
> "if " #devtypel " dev ${devnum}; then " \
> "setenv devtype " #devtypel "; " \
> "run scan_dev_for_boot_part; " \
> "fi\0"
>
> Which follows exactly that pattern.

I see.

>
>> > Signed-off-by: Sjoerd Simons 
>> > ---
>> >  common/cmd_sandbox.c | 48 
>> >  1 file changed, 48 insertions(+)
>> >
>> > diff --git a/common/cmd_sandbox.c b/common/cmd_sandbox.c
>> > index 4286969..7447d43 100644
>> > --- a/common/cmd_sandbox.c
>> > +++ b/common/cmd_sandbox.c
>> > @@ -10,6 +10,8 @@
>> >  #include 
>
>> > +   ret = host_get_dev_err(dev, &blk_dev);
>> > +   if (ret) {
>> > +   if (ret == -ENOENT)
>> > +   puts("Not bound to a backing file\n");
>>
>> Just use printf(), we should avoid puts() now.
>
> ok
>
>> > +   else if (ret == -ENODEV)
>> > +   puts("Invalid host device number\n");
>> > +
>> > +   return 1;
>> > +   }
>> > +
>> > +   sandbox_curr_device = dev;
>> > +   return 0;
>> > +}
>> > +
>> > +U_BOOT_CMD(
>> > +   host, 3, 2, do_host_dev,
>> > +   "Set or get current host device", "dev [dev] - Set or retrieve the 
>> > current host device"
>>
>> Can we make this command part of the 'sb' command? Like 'sh host ...'.
>
> In principle, sure, however that breaks the consistency with other
> commands which all use  , where
>  matches the names used in the fs and partition commands.
> Which is exactly the consistency _distro_bootcmd takes advantage of in
> the macro i mentioned above.
>
> My thinking was that the sb set of commands are used to manage/setup the
> sandbox interface (e.g. setting up the host device bindings) while in
> this case the host commands are for the more standard interaction with
> host interface devices.
>
>
> Another way of addressing this and essentially side-stepping this
> discussion would be to add a a new generic dev command to allow testing
> device existance e.g.
>   dev exists host 0
>   dev exists mmc 0
>
> And switch _distro_bootcmd to that instead of it relying on all block
> interfaces having a dev subcommand with the same semantics.
>
> Opinions ? :)

How about we change the existing 'sb' command to 'host'? Arguably 'sb'
is a bit of a silly name. We could maintain an alias for a while.

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


Re: [U-Boot] lcd-console / display rotation

2015-03-02 Thread Simon Glass
+Anatolij, Nikita

Hi,

On 2 March 2015 at 03:12, Hannes Petermaier
 wrote:
> Hello everybody,
>
> A short question about lcd-console:
>
> Today u-boot only supports a 'linear framebuffer', meaning the next pixel
> of a character is allways right after left and the framebuffer address is
> incrementing.
> We call this the display is mounted with 0° rotation.
>
> In some cases we have a rotated display.
> Maybe rotated by 90° to have portrait mode or even 180° due to mechanical
> issues.
>
> My question is:
> Is anybody currently working around this, having rotated display ?
> If not so, i would like start a implementation.
>
> 180° is quite easy, we only need to add some offset (total len of
> framebuffer) to our framebuffer base address and do -- instead ++ for
> drawing characters. Font can be reused.
>
> In the other cases, 90° and 270° it will maybe a bit tricky. I think a
> ?rotated font? is also necessary.
>
> Of course we have to think about the other functions like scroll up/down.

I don't know of anything, but it sounds useful.

Also I wonder if some hardware has support for this?

Nikita (on CC) is tidying up this part of U-Boot so get in touch with him.

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


Re: [U-Boot] [PATCH V3 0/11] ARM: OMAP3-DRA7: CP15 erratum workarounds and improvements

2015-03-02 Thread Tom Rini
On Thu, Feb 26, 2015 at 06:14:25PM +0200, Siarhei Siamashka wrote:
> On Thu, 26 Feb 2015 08:50:09 -0600
> Nishanth Menon  wrote:
> 
> > On Thu, Feb 26, 2015 at 1:40 AM, Siarhei Siamashka
> >  wrote:
> > > On Wed, 25 Feb 2015 14:55:08 -0600
> > > Nishanth Menon  wrote:
> > >
> > >> Hi,
> > >>
> > >> The third incarnation of this series to address various ideas of
> > >> previous V2 series. I will skip the full blurb and point to V1/V2
> > >> links for the usual blurb.
> > >>
> > >> Changes since V2:
> > >>   - Added documentation revisioning info with ARM erratums
> > >>   - patch series are split up to address ARM erratums first followed 
> > >> by TI
> > >> OMAP conversion
> > >>   - More OMAP3 now get erratum implementation - had to redo rx51 a 
> > >> little
> > >>   - I think is better helps exynos: 
> > >> https://patchwork.ozlabs.org/patch/443271/
> > >>   https://patchwork.ozlabs.org/patch/441863/
> > >>   - Rearranged the series to address generic ARM first followed by 
> > >> rest.
> > >>
> > >> V2: http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/213060
> > >> V1: http://comments.gmane.org/gmane.comp.boot-loaders.u-boot/212174
> > >>
> > >> Nishanth Menon (10):
> > >>   ARM: Introduce erratum workaround for 798870
> > >>   ARM: Introduce erratum workaround for 454179
> > >>   ARM: Introduce erratum workaround for 430973
> > >>   ARM: Introduce erratum workaround for 621766
> > >>   ARM: OMAP: Change set_pl310_ctrl_reg to be generic
> > >>   ARM: OMAP3: Rename omap3.h to omap.h to be generic as all SoCs
> > >>   ARM: OMAP3: Get rid of omap3_gp_romcode_call and replace with
> > >> omap_smc1
> > >>   ARM: OMAP5 / DRA7: Setup L2 Aux Control Register with recommended
> > >> configuration
> > >>   ARM: OMAP3: Enable workaround for ARM errata 454179, 430973, 621766
> > >>   ARM: OMAP3: rx51: Enable workaround for ARM errata 454179, 430973,
> > >> 621766
> > >>
> > >> Praveen Rao (1):
> > >>   ARM: DRA7 / OMAP5: Add workaround for ARM errata 798870
> > >
> > > Could you perhaps also pick up a workaround for "725233: PLD
> > > instructions executed with PLD data forwarding enabled can result
> > > in a processor deadlock" for old OMAP3 (r1pX revision of Cortex-A8)?
> > >
> > > 
> > > http://git.denx.de/?p=u-boot.git;a=commitdiff;h=041d42e789aba20296ffcde92173f100a9592880
> > >
> > > This used to be in U-Boot earlier, but seems to have vanished from the
> > > current U-Boot code. I would probably submit a patch myself, but I
> > > don't have such hardware anymore to test it.
> > 
> > Could I have a review by - I think I screwed up r1-r3 handling in
> > start.S when multiple erratas are enabled - which by some luck, I
> > have'nt hit.. I should probably fix that.
> 
> Sadly, I don't have this old hardware anymore. I have lent my first
> generation beagleboard to another person several years ago and have no
> idea where it is now. Maybe I should try to get it back one day :)
> 
> But taking the "formal" route, I checked who is the current beagleboard
> maintainer and looks like that's Tom Rini, who is already quite
> conveniently in the CC ;-)
> 
> Basically, this old hardware is either maintained or not. If it is
> maintained, then probably the board maintainer is the best person to
> review and test the errata patches.

Picking up again, I have original Beagleboards but I need a testcase.
Is it as simple as "Linux still boots to login on serial and doesn't
segfault everywhere" ?

-- 
Tom


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


Re: [U-Boot] mpc837xerdb: "fix Calling __hwconfig without a buffer" warning

2015-03-02 Thread Tom Rini
On Tue, Jan 20, 2015 at 08:47:01PM -0500, Sinan Akman wrote:

> Signed-off-by: Sinan Akman 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] mpc837xerdb: "fix Calling __hwconfig without a buffer" warning

2015-03-02 Thread Sinan Akman



  Hi Tom

On 02/03/2015 03:24 PM, Sinan Akman wrote:

Tom Rini wrote:

On 02/03/2015 02:31 PM, Sinan Akman wrote:

  Hi Tom

  As per our discussion with Kim at IRC, could you please
pick this for rc2 :

http://u-boot.10912.n7.nabble.com/PATCH-mpc837xerdb-fix-Calling-hwconfig-without-a-buffer-warning-tp202599.html



OK, I've assigned to myself in patchwork and I'll pick it up soon.
Thanks!



  Could you please pick up the patch above as we
agreed earlier. It fixes a warning and it didn't
find its way to -rc2.

  I cc'ed both of your new addresses.

  Thanks much

  Sinan Akman



   Perfect. Thanks much.

   I'll now cc you all mpx83xx patches and if we don't
hear from Kim for some time or any other comment I'll
remind you to apply. Kim seems to be fine with this
process.


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


[U-Boot] [PATCH v2 2/6] x86: video: Allow keyboard presence to be controlled by device tree

2015-03-02 Thread Simon Glass
At present a VGA console assumes a keyboard unless a CONFIG option is set.
This difference can be dealt with by a device tree option, allowing boards
that are otherwise the same to use the same configuration.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Correct #ifdef setup to avoid build errors on non-x86 boards

 doc/README.fdt-control  | 16 
 drivers/video/cfb_console.c | 29 +
 2 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/doc/README.fdt-control b/doc/README.fdt-control
index d8fe4a8..e6d5ed0 100644
--- a/doc/README.fdt-control
+++ b/doc/README.fdt-control
@@ -171,6 +171,22 @@ After board configuration is done, fdt supported u-boot 
can be build in two ways
 $ make DEVICE_TREE=
 
 
+Configuration Options
+-
+
+A number of run-time configuration options are provided in the /config node
+of the control device tree. You can access these using fdtdec_get_config_int(),
+fdtdec_get_config_bool() and fdtdec_get_config_string().
+
+Available options are:
+
+silent-console
+   If present and non-zero, the console is silenced by default on boot.
+
+no-keyboard
+   Tells U-Boot not to expect an attached keyboard with a VGA console
+
+
 Limitations
 ---
 
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index a81affa..f4231b8 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -87,6 +87,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2251,6 +2252,7 @@ int drv_video_init(void)
 {
int skip_dev_init;
struct stdio_dev console_dev;
+   bool have_keyboard;
 
/* Check if video initialization should be skipped */
if (board_video_skip())
@@ -2262,11 +2264,20 @@ int drv_video_init(void)
if (board_cfb_skip())
return 0;
 
+#if defined(CONFIG_VGA_AS_SINGLE_DEVICE)
+   have_keyboard = false;
+#elif defined(CONFIG_OF_CONTROL)
+   have_keyboard = !fdtdec_get_config_bool(gd->fdt_blob,
+   "u-boot,no-keyboard");
+#else
+   have_keyboard = true;
+#endif
+   if (have_keyboard) {
+   debug("KBD: Keyboard init ...\n");
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
-   debug("KBD: Keyboard init ...\n");
-   skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1);
+   skip_dev_init |= (VIDEO_KBD_INIT_FCT == -1);
 #endif
-
+   }
if (skip_dev_init)
return 0;
 
@@ -2279,11 +2290,13 @@ int drv_video_init(void)
console_dev.puts = video_puts;  /* 'puts' function */
 
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
-   /* Also init console device */
-   console_dev.flags |= DEV_FLAGS_INPUT;
-   console_dev.tstc = VIDEO_TSTC_FCT;  /* 'tstc' function */
-   console_dev.getc = VIDEO_GETC_FCT;  /* 'getc' function */
-#endif /* CONFIG_VGA_AS_SINGLE_DEVICE */
+   if (have_keyboard) {
+   /* Also init console device */
+   console_dev.flags |= DEV_FLAGS_INPUT;
+   console_dev.tstc = VIDEO_TSTC_FCT;  /* 'tstc' function */
+   console_dev.getc = VIDEO_GETC_FCT;  /* 'getc' function */
+   }
+#endif
 
if (stdio_register(&console_dev) != 0)
return 0;
-- 
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 1/6] x86: Support machines with >4GB of RAM

2015-03-02 Thread Simon Glass
Some systems have more than 4GB of RAM. U-Boot can only place things below
4GB so any memory above that should not be used. Ignore any such memory so
that the memory size will not exceed the maximum.

This prevents gd->ram_size exceeding 4GB which causes problems for PCI
devices which use DMA.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
---

Changes in v2: None

 arch/x86/cpu/coreboot/sdram.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/cpu/coreboot/sdram.c b/arch/x86/cpu/coreboot/sdram.c
index e98a230..9c3ab81 100644
--- a/arch/x86/cpu/coreboot/sdram.c
+++ b/arch/x86/cpu/coreboot/sdram.c
@@ -90,7 +90,8 @@ int dram_init(void)
struct memrange *memrange = &lib_sysinfo.memrange[i];
unsigned long long end = memrange->base + memrange->size;
 
-   if (memrange->type == CB_MEM_RAM && end > ram_size)
+   if (memrange->type == CB_MEM_RAM && end > ram_size &&
+   memrange->base < (1ULL << 32))
ram_size = end;
}
gd->ram_size = ram_size;
@@ -108,7 +109,8 @@ void dram_init_banksize(void)
for (i = 0, j = 0; i < lib_sysinfo.n_memranges; i++) {
struct memrange *memrange = &lib_sysinfo.memrange[i];
 
-   if (memrange->type == CB_MEM_RAM) {
+   if (memrange->type == CB_MEM_RAM &&
+   memrange->base < (1ULL << 32)) {
gd->bd->bi_dram[j].start = memrange->base;
gd->bd->bi_dram[j].size = memrange->size;
j++;
-- 
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 5/6] x86: Move common Chromebook config into a separate file

2015-03-02 Thread Simon Glass
Since Chromebooks mostly have similar configuration, put it in a common
file.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
---

Changes in v2: None

 include/configs/chromebook_link.h | 61 +--
 include/configs/x86-chromebook.h  | 68 +++
 2 files changed, 69 insertions(+), 60 deletions(-)
 create mode 100644 include/configs/x86-chromebook.h

diff --git a/include/configs/chromebook_link.h 
b/include/configs/chromebook_link.h
index 7b460e8..5265787 100644
--- a/include/configs/chromebook_link.h
+++ b/include/configs/chromebook_link.h
@@ -14,65 +14,6 @@
 #define __CONFIG_H
 
 #include 
-
-
-#define CONFIG_SYS_MONITOR_LEN (1 << 20)
-
-#define CONFIG_DCACHE_RAM_MRC_VAR_SIZE 0x4000
-#define CONFIG_BOARD_EARLY_INIT_F
-#define CONFIG_MISC_INIT_R
-
-#define CONFIG_NR_DRAM_BANKS   8
-#define CONFIG_X86_MRC_ADDR0xfffa
-#define CONFIG_CACHE_MRC_SIZE_KB   512
-
-#define CONFIG_X86_SERIAL
-
-#define CONFIG_SCSI_DEV_LIST   {PCI_VENDOR_ID_INTEL, \
-   PCI_DEVICE_ID_INTEL_NM10_AHCI},   \
-   {PCI_VENDOR_ID_INTEL,   \
-   PCI_DEVICE_ID_INTEL_COUGARPOINT_AHCI_MOBILE}, \
-   {PCI_VENDOR_ID_INTEL, \
-   PCI_DEVICE_ID_INTEL_COUGARPOINT_AHCI_SERIES6}, \
-   {PCI_VENDOR_ID_INTEL,   \
-   PCI_DEVICE_ID_INTEL_PANTHERPOINT_AHCI_MOBILE}
-
-#define CONFIG_X86_OPTION_ROM_FILE pci8086,0166.bin
-#define CONFIG_X86_OPTION_ROM_ADDR 0xfff9
-
-#define CONFIG_PCI_MEM_BUS 0xe000
-#define CONFIG_PCI_MEM_PHYSCONFIG_PCI_MEM_BUS
-#define CONFIG_PCI_MEM_SIZE0x1000
-
-#define CONFIG_PCI_PREF_BUS0xd000
-#define CONFIG_PCI_PREF_PHYS   CONFIG_PCI_PREF_BUS
-#define CONFIG_PCI_PREF_SIZE   0x1000
-
-#define CONFIG_PCI_IO_BUS  0x1000
-#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
-#define CONFIG_PCI_IO_SIZE 0xefff
-
-#define CONFIG_SYS_EARLY_PCI_INIT
-#define CONFIG_PCI_PNP
-
-#define CONFIG_BIOSEMU
-#define VIDEO_IO_OFFSET0
-#define CONFIG_X86EMU_RAW_IO
-
-#define CONFIG_CROS_EC
-#define CONFIG_CROS_EC_LPC
-#define CONFIG_CMD_CROS_EC
-#define CONFIG_ARCH_EARLY_INIT_R
-
-#undef CONFIG_ENV_IS_NOWHERE
-#undef CONFIG_ENV_SIZE
-#define CONFIG_ENV_SIZE0x1000
-#define CONFIG_ENV_SECT_SIZE   0x1000
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_OFFSET  0x003f8000
-
-#define CONFIG_STD_DEVICES_SETTINGS "stdin=usbkbd,vga,serial\0" \
-   "stdout=vga,serial\0" \
-   "stderr=vga,serial\0"
+#include 
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/x86-chromebook.h b/include/configs/x86-chromebook.h
new file mode 100644
index 000..b6a76fe
--- /dev/null
+++ b/include/configs/x86-chromebook.h
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (c) 2015 Google, Inc
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _X86_CHROMEBOOK_H
+#define _X86_CHROMEBOOK_H
+
+#define CONFIG_SYS_MONITOR_LEN (1 << 20)
+
+#define CONFIG_DCACHE_RAM_MRC_VAR_SIZE 0x4000
+#define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_MISC_INIT_R
+
+#define CONFIG_NR_DRAM_BANKS   8
+#define CONFIG_X86_MRC_ADDR0xfffa
+#define CONFIG_CACHE_MRC_SIZE_KB   512
+
+#define CONFIG_X86_SERIAL
+
+#define CONFIG_SCSI_DEV_LIST   \
+   {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_NM10_AHCI}, \
+   {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COUGARPOINT_AHCI_MOBILE}, \
+   {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_COUGARPOINT_AHCI_SERIES6}, \
+   {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PANTHERPOINT_AHCI_MOBILE}, \
+   {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LYNXPOINT_AHCI}
+
+#define CONFIG_X86_OPTION_ROM_FILE pci8086,0166.bin
+#define CONFIG_X86_OPTION_ROM_ADDR 0xfff9
+
+#define CONFIG_PCI_MEM_BUS 0xe000
+#define CONFIG_PCI_MEM_PHYSCONFIG_PCI_MEM_BUS
+#define CONFIG_PCI_MEM_SIZE0x1000
+
+#define CONFIG_PCI_PREF_BUS0xd000
+#define CONFIG_PCI_PREF_PHYS   CONFIG_PCI_PREF_BUS
+#define CONFIG_PCI_PREF_SIZE   0x1000
+
+#define CONFIG_PCI_IO_BUS  0x1000
+#define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
+#define CONFIG_PCI_IO_SIZE 0xefff
+
+#define CONFIG_SYS_EARLY_PCI_INIT
+#define CONFIG_PCI_PNP
+
+#define CONFIG_BIOSEMU
+#define VIDEO_IO_OFFSET0
+#define CONFIG_X86EMU_RAW_IO
+
+#define CONFIG_CROS_EC
+#define CONFIG_CROS_EC_LPC
+#define CONFIG_CMD_CROS_EC
+#define CONFIG_ARCH_EARLY_INIT_R
+
+#undef CONFIG_ENV_IS_NOWHERE
+#undef CONFIG_ENV_SIZE
+#define CONFIG_ENV_SIZE0x1000
+#define CONFIG_ENV_SECT_SIZE   0x1000
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET  0x003f8000
+
+

[U-Boot] [PATCH v2 6/6] x86: Add support for panther (Asus Chromebox)

2015-03-02 Thread Simon Glass
Support running U-Boot as a coreboot payload. Tested peripherals include:

- Video (HDMI and DisplayPort)
- SATA disk
- Gigabit Ethernet
- SPI flash

USB3 does not work. This may be a problem with the USB3 PCI driver or
something in the USB3 stack and has not been investigated So far this is
disabled. The SD card slot also does not work.

For video, coreboot will need to run the OPROM to set this up.

With this board, bare support (running without coreboot) is not available
as yet.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Update Kconfig and MAINTAINERS file to build bare
- Use "intel,haswell" as the compatible name

 arch/x86/Kconfig   | 16 
 arch/x86/dts/Makefile  |  1 +
 arch/x86/dts/chromebox_panther.dts | 64 ++
 board/google/chromebox_panther/Kconfig | 34 
 board/google/chromebox_panther/MAINTAINERS |  6 +++
 board/google/chromebox_panther/Makefile|  7 
 board/google/chromebox_panther/panther.c   | 22 ++
 configs/chromebox_panther_defconfig| 11 +
 include/configs/chromebox_panther.h| 17 
 9 files changed, 178 insertions(+)
 create mode 100644 arch/x86/dts/chromebox_panther.dts
 create mode 100644 board/google/chromebox_panther/Kconfig
 create mode 100644 board/google/chromebox_panther/MAINTAINERS
 create mode 100644 board/google/chromebox_panther/Makefile
 create mode 100644 board/google/chromebox_panther/panther.c
 create mode 100644 configs/chromebox_panther_defconfig
 create mode 100644 include/configs/chromebox_panther.h

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 35d24e4..d6176d2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -32,6 +32,20 @@ config TARGET_CHROMEBOOK_LINK
  and it provides a 2560x1700 high resolution touch-enabled LCD
  display.
 
+config TARGET_CHROMEBOX_PANTHER
+   bool "Support Chromebox panther (not available)"
+   select n
+   help
+ Note: At present this must be used with Coreboot. See README.x86
+ for instructions.
+
+ This is the Asus Chromebox CN60 released in 2014. It uses an Intel
+ Haswell Celeron 2955U Dual Core CPU with 2GB of SDRAM. It has a
+ Lynx Point platform controller hub, PCIe WiFi and Bluetooth. It also
+ includes a USB SD reader, four USB3 ports, display port and HDMI
+ video output and a 16GB SATA solid state drive. There is no Chrome
+ OS EC on this model.
+
 config TARGET_CROWNBAY
bool "Support Intel Crown Bay CRB"
help
@@ -435,6 +449,8 @@ source "board/coreboot/coreboot/Kconfig"
 
 source "board/google/chromebook_link/Kconfig"
 
+source "board/google/chromebox_panther/Kconfig"
+
 source "board/intel/crownbay/Kconfig"
 
 source "board/intel/minnowmax/Kconfig"
diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
index 7a66133..431bbd8 100644
--- a/arch/x86/dts/Makefile
+++ b/arch/x86/dts/Makefile
@@ -1,4 +1,5 @@
 dtb-y += chromebook_link.dtb \
+   chromebox_panther.dtb \
crownbay.dtb \
galileo.dtb \
minnowmax.dtb
diff --git a/arch/x86/dts/chromebox_panther.dts 
b/arch/x86/dts/chromebox_panther.dts
new file mode 100644
index 000..4eccefd
--- /dev/null
+++ b/arch/x86/dts/chromebox_panther.dts
@@ -0,0 +1,64 @@
+/dts-v1/;
+
+/include/ "skeleton.dtsi"
+/include/ "serial.dtsi"
+
+/ {
+   model = "Google Panther";
+   compatible = "google,panther", "intel,haswell";
+
+   aliases {
+   spi0 = "/spi";
+   };
+
+   config {
+   silent-console = <0>;
+   no-keyboard;
+   };
+
+   gpioa {
+   compatible = "intel,ich6-gpio";
+   u-boot,dm-pre-reloc;
+   reg = <0 0x10>;
+   bank-name = "A";
+   };
+
+   gpiob {
+   compatible = "intel,ich6-gpio";
+   u-boot,dm-pre-reloc;
+   reg = <0x30 0x10>;
+   bank-name = "B";
+   };
+
+   gpioc {
+   compatible = "intel,ich6-gpio";
+   u-boot,dm-pre-reloc;
+   reg = <0x40 0x10>;
+   bank-name = "C";
+   };
+
+   chosen {
+   stdout-path = "/serial";
+   };
+
+   spi {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   compatible = "intel,ich-spi";
+   spi-flash@0 {
+   #size-cells = <1>;
+   #address-cells = <1>;
+   reg = <0>;
+   compatible = "winbond,w25q64", "spi-flash";
+   memory-map = <0xff80 0x0080>;
+   rw-mrc-cache {
+   label = "rw-mrc-cache";
+   /* Alignment: 4k (for updating) */
+   reg = <0x003e 0x0001>;
+   type = "wiped";
+  

[U-Boot] [PATCH v2 3/6] x86: pci: Add PCI IDs for lynxpoint

2015-03-02 Thread Simon Glass
Add some new device IDs used by this haswell-based chipset.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
---

Changes in v2:
- Put this patch before the one that needs it

 include/pci_ids.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/pci_ids.h b/include/pci_ids.h
index dc2ca21..2e66851 100644
--- a/include/pci_ids.h
+++ b/include/pci_ids.h
@@ -3016,6 +3016,8 @@
 #define PCI_DEVICE_ID_INTEL_TCF_UART_2 0x8813
 #define PCI_DEVICE_ID_INTEL_TCF_UART_3 0x8814
 #define PCI_DEVICE_ID_INTEL_IXP28000x9004
+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_AHCI 0x9c03
+#define PCI_DEVICE_ID_INTEL_LYNXPOINT_LPC  0x9c45
 #define PCI_DEVICE_ID_INTEL_S21152BB   0xb152
 
 #define PCI_VENDOR_ID_SCALEMP  0x8686
-- 
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 4/6] x86: spi: Add support for lynxpoint

2015-03-02 Thread Simon Glass
Add Lynxpoint to the driver so that the Asus Chromebox can be supported.

Signed-off-by: Simon Glass 
Reviewed-by: Jagannadha Sutradharudu Teki 
---

Changes in v2: None

 drivers/spi/ich.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index 194e882..9848e0b 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -185,7 +185,8 @@ static int get_ich_version(uint16_t device_id)
 device_id <= PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX) ||
(device_id >= PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MIN &&
 device_id <= PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MAX) ||
-   device_id == PCI_DEVICE_ID_INTEL_VALLEYVIEW_LPC)
+   device_id == PCI_DEVICE_ID_INTEL_VALLEYVIEW_LPC ||
+   device_id == PCI_DEVICE_ID_INTEL_LYNXPOINT_LPC)
return 9;
 
return 0;
-- 
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] [PATCH v1]dm : spi: Convert Freescale DSPI to driver model

2015-03-02 Thread Michael Trimarchi
Hi

On 1 Mar 2015 22:09, "haikun.w...@freescale.com" 
wrote:
>
> Move the Freescale DSPI driver over to driver model.
>
> Signed-off-by: Haikun Wang >
> ---
>
> This patch adds two new files drivers/spi/fsl_dspi.c and
include/fsl_dspi.h.
> They will replace files drivers/spi/cf_spi.c and
arch/m68k/include/asm/coldfire/dspi.h.
> I need submit patch to remove them later.
> Board dts files are also needed to make this change work.
>
> Changes in v1: None
>
>  drivers/spi/Makefile   |   1 +
>  drivers/spi/fsl_dspi.c | 461
+
>  include/fsl_dspi.h | 156 +
>  3 files changed, 618 insertions(+)
>  create mode 100644 drivers/spi/fsl_dspi.c
>  create mode 100644 include/fsl_dspi.h
>
> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
> index edbd520..9c2b8de 100644
> --- a/drivers/spi/Makefile
> +++ b/drivers/spi/Makefile
> @@ -49,3 +49,4 @@ obj-$(CONFIG_TI_QSPI) += ti_qspi.o
>  obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o
>  obj-$(CONFIG_ZYNQ_SPI) += zynq_spi.o
>  obj-$(CONFIG_FSL_QSPI) += fsl_qspi.o
> +obj-$(CONFIG_FSL_DSPI) += fsl_dspi.o
> diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
> new file mode 100644
> index 000..69c037b
> --- /dev/null
> +++ b/drivers/spi/fsl_dspi.c
> @@ -0,0 +1,461 @@
> +/*
> + * (C) Copyright 2000-2003
> + * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> + *
> + * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
> + * TsiChung Liew (tsi-chung.l...@freescale.com)
> + * Chao Fu (b44...@freescale.com)
> + * Haikun Wang (b53...@freescale.com)
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +

Extra here

> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/* fsl_dspi_platdata flag */
> +#define DSPI_FLAG_REGMAP_ENDIAN_BIG(1 << 0)
> +
> +/* idle data value */
> +#define DSPI_IDLE_VAL (0x0)
> +
> +/* max chipselect signals number */
> +#define FSL_DSPI_MAX_CHIPSELECT(6)
> +
> +/* CTAR register pre-configure value */
> +#define DSPI_CTAR_DEFAULT_VALUE(DSPI_CTAR_TRSZ(7) | \
> +   DSPI_CTAR_PCSSCK_1CLK | \
> +   DSPI_CTAR_PASC(0) | \
> +   DSPI_CTAR_PDT(0) | \
> +   DSPI_CTAR_CSSCK(0) | \
> +   DSPI_CTAR_ASC(0) | \
> +   DSPI_CTAR_DT(0))
> +
> +/* CTAR register pre-configure mask */
> +#define DSPI_CTAR_SET_MODE_MASK(DSPI_CTAR_TRSZ(15) | \
> +   DSPI_CTAR_PCSSCK(3) | \
> +   DSPI_CTAR_PASC(3) | \
> +   DSPI_CTAR_PDT(3) | \
> +   DSPI_CTAR_CSSCK(15) | \
> +   DSPI_CTAR_ASC(15) | \
> +   DSPI_CTAR_DT(15))
> +
> +struct fsl_dspi_platdata {
> +   uint flag;
> +   uint baudrate;
> +   uint num_chipselect;
> +   uint regs;
> +};
> +
> +struct fsl_dspi_priv {
> +   uint mode;
> +   uint mcr_val;
> +   uint bus_clk;
> +   uint baudrate;
> +   uint charbit;
> +   uint num_chipselect;
> +   uint ctar_val[FSL_DSPI_MAX_CHIPSELECT];
> +   uint regs;
> +   struct dm_spi_slave_platdata *cur_slave_plat;
> +};
> +
> +static uint dspi_read32(struct udevice *bus, uint offset)
> +{
> +   struct fsl_dspi_platdata *plat = dev_get_platdata(bus);
> +   return plat->flag & DSPI_FLAG_REGMAP_ENDIAN_BIG ?
> +   in_be32(plat->regs + offset) : in_le32(plat->regs +
offset);
> +}
> +
> +static void dspi_write32(struct udevice *bus, uint offset, uint val)
> +{
> +   struct fsl_dspi_platdata *plat = dev_get_platdata(bus);
> +   plat->flag & DSPI_FLAG_REGMAP_ENDIAN_BIG ?
> +   out_be32(plat->regs + offset, val) :
> +   out_le32(plat->regs + offset, val);
> +   return;

Remove return

> +}
> +
> +static void dspi_halt(struct udevice *bus, u8 halt)
> +{
> +   uint mcr_val;
> +
> +   mcr_val = dspi_read32(bus, DSPI_MCR);
> +
> +   if (halt)
> +   mcr_val |= DSPI_MCR_HALT;
> +   else
> +   mcr_val &= ~DSPI_MCR_HALT;
> +
> +   dspi_write32(bus, DSPI_MCR, mcr_val);
> +
> +   return;

Ditto

> +}
> +
> +static int fsl_dspi_child_pre_probe(struct udevice *dev)
> +{
> +   struct dm_spi_slave_platdata *slave_plat =
dev_get_parent_platdata(dev);
> +   struct fsl_dspi_priv *priv = dev_get_priv(dev->parent);
> +
> +   if (slave_plat->cs >= priv->num_chipselect) {
> +   printf("DSPI invalid chipselect number %d(max %d)!\n",
> +  slave_plat->cs, priv->num_chipselect - 1);
> +  

Re: [U-Boot] [PATCH v1]dm : spi: Convert Freescale DSPI to driver model

2015-03-02 Thread Simon Glass
Hi,

On 28 February 2015 at 03:54, haikun.w...@freescale.com
 wrote:
> Move the Freescale DSPI driver over to driver model.
>
> Signed-off-by: Haikun Wang 
> ---
>
> This patch adds two new files drivers/spi/fsl_dspi.c and include/fsl_dspi.h.
> They will replace files drivers/spi/cf_spi.c and
> arch/m68k/include/asm/coldfire/dspi.h.
> I need submit patch to remove them later.
> Board dts files are also needed to make this change work.

Apart from one thing (the chip selects) this all looks correct to me.
Some style comments below. Also the patch seems to be in Courier font!

I'm interested in your thoughts on what is missing from the SPI uclass too.

>
> Changes in v1: None
>
> drivers/spi/Makefile   |   1 +
> drivers/spi/fsl_dspi.c | 461
> +
> include/fsl_dspi.h | 156 +
> 3 files changed, 618 insertions(+)
> create mode 100644 drivers/spi/fsl_dspi.c
> create mode 100644 include/fsl_dspi.h
>
> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
> index edbd520..9c2b8de 100644
> --- a/drivers/spi/Makefile
> +++ b/drivers/spi/Makefile
> @@ -49,3 +49,4 @@ obj-$(CONFIG_TI_QSPI) += ti_qspi.o
> obj-$(CONFIG_XILINX_SPI) += xilinx_spi.o
> obj-$(CONFIG_ZYNQ_SPI) += zynq_spi.o
> obj-$(CONFIG_FSL_QSPI) += fsl_qspi.o
> +obj-$(CONFIG_FSL_DSPI) += fsl_dspi.o
> diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c
> new file mode 100644
> index 000..69c037b
> --- /dev/null
> +++ b/drivers/spi/fsl_dspi.c
> @@ -0,0 +1,461 @@
> +/*
> + * (C) Copyright 2000-2003
> + * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
> + *
> + * Copyright (C) 2004-2009, 2015 Freescale Semiconductor, Inc.
> + * TsiChung Liew (tsi-chung.l...@freescale.com)
> + * Chao Fu (b44...@freescale.com)
> + * Haikun Wang (b53...@freescale.com)
> + *
> + * SPDX-License-Identifier:GPL-2.0+
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +

Remove extract blank line

> +DECLARE_GLOBAL_DATA_PTR;
> +
> +/* fsl_dspi_platdata flag */
> +#define DSPI_FLAG_REGMAP_ENDIAN_BIG(1 << 0)
> +
> +/* idle data value */
> +#define DSPI_IDLE_VAL (0x0)

Please no brackets around simple constants (I understand if they are
-ve, but this serves no purpose).

> +
> +/* max chipselect signals number */
> +#define FSL_DSPI_MAX_CHIPSELECT(6)
> +
> +/* CTAR register pre-configure value */
> +#define DSPI_CTAR_DEFAULT_VALUE(DSPI_CTAR_TRSZ(7) | \
> +   DSPI_CTAR_PCSSCK_1CLK | \
> +   DSPI_CTAR_PASC(0) | \
> +   DSPI_CTAR_PDT(0) | \
> +   DSPI_CTAR_CSSCK(0) | \
> +   DSPI_CTAR_ASC(0) | \
> +   DSPI_CTAR_DT(0))
> +
> +/* CTAR register pre-configure mask */
> +#define DSPI_CTAR_SET_MODE_MASK(DSPI_CTAR_TRSZ(15) | \
> +   DSPI_CTAR_PCSSCK(3) | \
> +   DSPI_CTAR_PASC(3) | \
> +   DSPI_CTAR_PDT(3) | \
> +   DSPI_CTAR_CSSCK(15) | \
> +   DSPI_CTAR_ASC(15) | \
> +   DSPI_CTAR_DT(15))
> +

Please comment these things below:

/**
 * struct fsl_dspi_platdata - platform data for ...
 *
 * @flag:some sort of flag and you can find the enum here...
...

> +struct fsl_dspi_platdata {
> +   uint flag;
> +   uint baudrate;
> +   uint num_chipselect;
> +   uint regs;
> +};
> +
> +struct fsl_dspi_priv {
> +   uint mode;
> +   uint mcr_val;
> +   uint bus_clk;
> +   uint baudrate;
> +   uint charbit;
> +   uint num_chipselect;
> +   uint ctar_val[FSL_DSPI_MAX_CHIPSELECT];
> +   uint regs;
> +   struct dm_spi_slave_platdata *cur_slave_plat;

What is that for?

> +};
> +
> +static uint dspi_read32(struct udevice *bus, uint offset)
> +{
> +   struct fsl_dspi_platdata *plat = dev_get_platdata(bus);

blank line between declarations and code (throughout)

> +   return plat->flag & DSPI_FLAG_REGMAP_ENDIAN_BIG ?
> +   in_be32(plat->regs + offset) : in_le32(plat->regs + offset);

I think it is better to put regs in your private data rather than
platform data. Platform data should be used in your probe function
mostly. It's OK to use it sparing for uncommon things, but this feels
like something that should be in private data.

I have tended to put an fdt_addr_t in platform data and a struct
reg_definition * in private data.

Also where is your C structure for the registers? We normally use that
sort of thing in U-Boot.

> +}
> +
> +static void dspi_write32(struct udevice *bus, uint offset, uint val)
> +{
> +   struct fsl_dspi_platdata *plat = dev_get_platdata(bus);
> +   plat->flag & DSPI_FLAG_

Re: [U-Boot] [PATCH 4/6] config_distro_bootcmd.h: Add shared block definition for the host interface

2015-03-02 Thread Simon Glass
Hi,

On 2 March 2015 at 09:54, Stephen Warren  wrote:
> On 02/28/2015 07:14 AM, Simon Glass wrote:
>>
>> +Stephen for real this time
>>
>> Hi Sjoerd,
>>
>> On 28 February 2015 at 07:05, Sjoerd Simons
>>  wrote:
>>>
>>> On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote:

 +Stephen who knows more about this stuff

 On 19 February 2015 at 15:41, Sjoerd Simons
  wrote:
>
> Define the common shared block environment for the host interface in
> preperation for the sandbox build to use config_distro_bootcmd.
>
> Signed-off-by: Sjoerd Simons 
> ---
>   include/config_distro_bootcmd.h | 13 +
>   1 file changed, 13 insertions(+)
>
> diff --git a/include/config_distro_bootcmd.h
> b/include/config_distro_bootcmd.h
> index 07a0b3b..ff0e3a8 100644
> --- a/include/config_distro_bootcmd.h
> +++ b/include/config_distro_bootcmd.h
> @@ -32,6 +32,18 @@
>   #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \
>  #devtypel #instance " "
>
> +#ifdef CONFIG_SANDBOX
> +#define BOOTENV_SHARED_HOSTBOOTENV_SHARED_BLKDEV(host)
> +#define BOOTENV_DEV_HOST   BOOTENV_DEV_BLKDEV
> +#define BOOTENV_DEV_NAME_HOST  BOOTENV_DEV_NAME_BLKDEV
> +#else
> +#define BOOTENV_SHARED_HOST
> +#define BOOTENV_DEV_HOST \
> +   BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX
> +#define BOOTENV_DEV_NAME_HOST \


 Can we use upper case in #defines?
>>>
>>>
>>> The reason for this is that it is consistent with all other block device
>>> blocks in that file e.g:
>>>
>>> #define BOOTENV_DEV_SATA \
>>> BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA
>>>
>>> So i'd prefer to to keep it that way. Btw, note that this is used for
>>> compile time error reporting rather then something you'd refer to in
>>> code.
>>
>>
>> OK I see.
>
>
> Yes, in this case that mixed-case variable name is essentially an error
> message to the user. The mixed case hopefully makes it more legible since
> only other variable names are in upper case, and the rest of the warning
> text is lower case. We can't use e.g. #error here, since this error can only
> be detected in the middle of a macro expansion rather than via some
> top-level singleton #if/#ifdef check.

Makes sense. Maybe we could add a comment to this effect?

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


Re: [U-Boot] [PATCH][v2] rsa : Compile Modular Exponentiation files based on CONFIG_RSA_SOFTWARE_EXP

2015-03-02 Thread Simon Glass
On 26 February 2015 at 20:40, Gaurav Rana  wrote:
> Remove dependency of rsa_mod_exp from CONFIG_FIT_SIGNATURE.
> As rsa modular exponentiation is an independent module
> and can be invoked independently.
>
> Signed-off-by: Gaurav Rana 
> Reviewed-by: Simon Glass 
> CC: Simon Glass 
> ---
> Changes in v2:
> add elaborated commit message.
>
>  drivers/crypto/rsa_mod_exp/Makefile | 3 ++-
>  lib/rsa/Makefile| 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)

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


Re: [U-Boot] [PATCH] arm: imx: Fix conflicting definition types of 'get_reset_cause'

2015-03-02 Thread Otavio Salvador
On Mon, Mar 2, 2015 at 3:32 PM, Stefano Babic  wrote:
> Hi Marek, Otavio,
>
> On 02/03/2015 19:27, Marek Vasut wrote:
>> On Monday, March 02, 2015 at 07:10:58 PM, Otavio Salvador wrote:
>>> The common i.MX definition of 'get_reset_cause' function is non-static
>>> so the overriden ones should follow it. This fixes following error:
>>>
>>> ,
>>>
>>> |  arch/arm/imx-common/cpu.c:29:14: error: static declaration
>>> |
>>> |   of 'get_reset_cause' follows non-static declaration
>>> |   static char *get_reset_cause(void)
>>>
>>> `
>>>
>>> The fix has been done in all i.MX based SoCs plus vf610.
>>>
>>> Fixes [YOCTO: #7384].
>>>
>>> Signed-off-by: Otavio Salvador 
>>
>> You should instead drop the prototype from sys_proto.h and repair
>> the only one non-static occurance in arch/arm/imx-common/cpu.c .
>>
>
> This is the fix I sent this morning:
>
> http://patchwork.ozlabs.org/patch/445002/

Sorry; I missed this one. This fixes the issue. :-D

Thanks!

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: sdhci: don't clobber adjacent registers

2015-03-02 Thread Pantelis Antoniou
Hi Matt,

> On Feb 23, 2015, at 23:56 , Matt Reimer  wrote:
> 
> SDHCI_HOST_CONTROL is a byte-sized register, so don't write to it
> as if it were a long, as that would result in clobbering the three
> registers following.
> 
> Signed-off-by: Matt Reimer 
> ---
> drivers/mmc/sdhci.c |2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 82d7984..1f8917b 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -412,7 +412,7 @@ static int sdhci_init(struct mmc *mmc)
>   if (host->quirks & SDHCI_QUIRK_NO_CD) {
>   unsigned int status;
> 
> - sdhci_writel(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST,
> + sdhci_writeb(host, SDHCI_CTRL_CD_TEST_INS | SDHCI_CTRL_CD_TEST,
>   SDHCI_HOST_CONTROL);
> 
>   status = sdhci_readl(host, SDHCI_PRESENT_STATE);
> -- 
> 1.7.9.5
> 

The patch is obviously correct and I’ll pick it up for my next pull-req.

Relax :)

Regards

— Pantelis

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


Re: [U-Boot] [PATCH] arm: imx: Fix conflicting definition types of 'get_reset_cause'

2015-03-02 Thread Stefano Babic
Hi Marek, Otavio,

On 02/03/2015 19:27, Marek Vasut wrote:
> On Monday, March 02, 2015 at 07:10:58 PM, Otavio Salvador wrote:
>> The common i.MX definition of 'get_reset_cause' function is non-static
>> so the overriden ones should follow it. This fixes following error:
>>
>> ,
>>
>> |  arch/arm/imx-common/cpu.c:29:14: error: static declaration
>> |  
>> |   of 'get_reset_cause' follows non-static declaration
>> |   static char *get_reset_cause(void)
>>
>> `
>>
>> The fix has been done in all i.MX based SoCs plus vf610.
>>
>> Fixes [YOCTO: #7384].
>>
>> Signed-off-by: Otavio Salvador 
> 
> You should instead drop the prototype from sys_proto.h and repair
> the only one non-static occurance in arch/arm/imx-common/cpu.c .
> 

This is the fix I sent this morning:

http://patchwork.ozlabs.org/patch/445002/

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] mmc: s5p: properly mask SELBASECLK

2015-03-02 Thread Matt Reimer
On Mon, Feb 23, 2015 at 2:52 PM, Matt Reimer  wrote:

> Properly mask SELBASECLK by using an actual mask rather than the
> number of bits to shift in order to create the mask.
>
> Signed-off-by: Matt Reimer 
> ---
>  drivers/mmc/s5p_sdhci.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/s5p_sdhci.c b/drivers/mmc/s5p_sdhci.c
> index 3899372..0eec731 100644
> --- a/drivers/mmc/s5p_sdhci.c
> +++ b/drivers/mmc/s5p_sdhci.c
> @@ -30,7 +30,7 @@ static void s5p_sdhci_set_control_reg(struct sdhci_host
> *host)
> sdhci_writel(host, SDHCI_CTRL4_DRIVE_MASK(0x3), SDHCI_CONTROL4);
>
> val = sdhci_readl(host, SDHCI_CONTROL2);
> -   val &= SDHCI_CTRL2_SELBASECLK_SHIFT;
> +   val &= SDHCI_CTRL2_SELBASECLK_MASK(3);
>
> val |=  SDHCI_CTRL2_ENSTAASYNCCLR |
> SDHCI_CTRL2_ENCMDCNFMSK |
> --
> 1.7.9.5
>
>
ping
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mmc: sdhci: don't clobber adjacent registers

2015-03-02 Thread Matt Reimer
On Mon, Feb 23, 2015 at 2:56 PM, Matt Reimer  wrote:

> SDHCI_HOST_CONTROL is a byte-sized register, so don't write to it
> as if it were a long, as that would result in clobbering the three
> registers following.
>
> Signed-off-by: Matt Reimer 
> ---
>  drivers/mmc/sdhci.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 82d7984..1f8917b 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -412,7 +412,7 @@ static int sdhci_init(struct mmc *mmc)
> if (host->quirks & SDHCI_QUIRK_NO_CD) {
> unsigned int status;
>
> -   sdhci_writel(host, SDHCI_CTRL_CD_TEST_INS |
> SDHCI_CTRL_CD_TEST,
> +   sdhci_writeb(host, SDHCI_CTRL_CD_TEST_INS |
> SDHCI_CTRL_CD_TEST,
> SDHCI_HOST_CONTROL);
>
> status = sdhci_readl(host, SDHCI_PRESENT_STATE);
> --
> 1.7.9.5
>
>
ping
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: imx: Fix conflicting definition types of 'get_reset_cause'

2015-03-02 Thread Marek Vasut
On Monday, March 02, 2015 at 07:10:58 PM, Otavio Salvador wrote:
> The common i.MX definition of 'get_reset_cause' function is non-static
> so the overriden ones should follow it. This fixes following error:
> 
> ,
> 
> |  arch/arm/imx-common/cpu.c:29:14: error: static declaration
> |  
> |   of 'get_reset_cause' follows non-static declaration
> |   static char *get_reset_cause(void)
> 
> `
> 
> The fix has been done in all i.MX based SoCs plus vf610.
> 
> Fixes [YOCTO: #7384].
> 
> Signed-off-by: Otavio Salvador 

You should instead drop the prototype from sys_proto.h and repair
the only one non-static occurance in arch/arm/imx-common/cpu.c .

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


Re: [U-Boot] [GIT PULL] Xilinx ZynqMP

2015-03-02 Thread Tom Rini
On Mon, Mar 02, 2015 at 06:47:17PM +0100, Michal Simek wrote:

> Hi Tom,
> 
> please consider to pull this Xilinx ZynqMP platform support to your tree.
> 
> Thanks,
> Michal
> 
> The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55:
> 
>   Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 
> 18:14:18 -0500)
> 
> are available in the git repository at:
> 
> 
>   git://www.denx.de/git/u-boot-microblaze.git xnext/zynqmp
> 
> for you to fetch changes up to 84c7204bd18a0051a353c7a6f65a5666e1af9501:
> 
>   arm64: Add Xilinx ZynqMP support (2015-03-02 18:41:54 +0100)
> 

Applied to u-boot/master, thanks!



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


-- 
Tom


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


Re: [U-Boot] [PATCH] arm64: Add Xilinx ZynqMP support

2015-03-02 Thread Tom Rini
On Mon, Mar 02, 2015 at 09:10:26AM -0800, Sören Brinkmann wrote:
> On Mon, 2015-03-02 at 04:07PM +0100, Michal Simek wrote:
> > On 03/02/2015 03:23 PM, Tom Rini wrote:
> > > On Mon, Mar 02, 2015 at 09:24:45AM +0100, Michal Simek wrote:
> > >> On 03/02/2015 08:32 AM, Michal Simek wrote:
> > >>> On 02/27/2015 06:13 PM, Tom Rini wrote:
> >  On Tue, Feb 24, 2015 at 09:02:09AM +0100, Michal Simek wrote:
> > 
> > > Add basic Xilinx ZynqMP arm64 support.
> > > Serial and SD is supported.
> > > It supports emulation platfrom ep108 and QEMU.
> > >
> > > Signed-off-by: Michal Simek 
> >  [snip]
> > > +/* Miscellaneous configurable options */
> > > +#define CONFIG_SYS_LOAD_ADDR 0x800
> > > +
> > > +/* Initial environment variables */
> > > +#define CONFIG_EXTRA_ENV_SETTINGS \
> > > + "ethaddr=00:0a:35:00:01:22\0" \
> > 
> >  No, you can't hard-code an ethaddr in.
> > >>>
> > >>> ah yeah.
> > >>>
> > 
> > > + "kernel_addr=0x20\0" \
> > > + "initrd_addr=0xa0\0" \
> > > + "initrd_size=0x200\0" \
> > 
> >  These are really close together.  And I imagine mirror the usual values
> >  on 32bit platforms.  Maybe it's time to move them around a bit for more
> >  space?
> > >>>
> > >>> Currently I haven't had any problem with these values but I just don't 
> > >>> know
> > >>> what will happen in future.
> > > 
> > > Right.  That's partly why I moved as much of the TI ARMv7 parts to the
> > > Linux kernel defined limits a while back, people managed to bump into
> > > overruns doing valid things.  I'd really like to see things default to
> > > something closer to the defined limits to start with and avoid those
> > > kind of problems a few years down the line.  8MB is fine for now but I
> > > can see people running over that and going "why does my initrd boot
> > > fail".
> > 
> > We will use FIT image and all these values won't be needed but
> > they are need to be here.
> > I have removed unused initrd_X in v2 because it is completely unused.
> 
> Well, I haven't used FIT images so far and don't see why I should. Can we
> please put the initrd at the highest address amongst kernel, DT and
> initrd? The initrd is most prone grow. My current one is beyond 100MB.
> Let's just spread things out, there should be enough memory for this.

Only along with doing bootm_size so that however data is passed in, we
make sure it ends up (a) not overlapping and (b) where the kernel will
see it.

-- 
Tom


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


Re: [U-Boot] [PATCH v2] warp: Add a README file

2015-03-02 Thread Otavio Salvador
On Mon, Mar 2, 2015 at 3:14 PM, Fabio Estevam  wrote:
> Hi Otavio,
>
> On Mon, Mar 2, 2015 at 3:12 PM, Otavio Salvador  
> wrote:
>
>> Well this README is covering WaRP so we ought to cover WaRP specifics there.
>
> What is the exact part of the README that has problems?
>
> Sorry, I am not able to get your point.
>
> Please be specific.

Sorry; now it is clear. You need the env to DFU to work.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] warp: Add a README file

2015-03-02 Thread Fabio Estevam
Hi Otavio,

On Mon, Mar 2, 2015 at 3:12 PM, Otavio Salvador  wrote:

> Well this README is covering WaRP so we ought to cover WaRP specifics there.

What is the exact part of the README that has problems?

Sorry, I am not able to get your point.

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


Re: [U-Boot] [PATCH v2] warp: Add a README file

2015-03-02 Thread Otavio Salvador
On Mon, Mar 2, 2015 at 2:53 PM, Fabio Estevam  wrote:
> Hi Otavio,
>
> On Mon, Mar 2, 2015 at 2:36 PM, Otavio Salvador  
> wrote:
>>> +Use the default environment variables:
>>> +
>>> +=> env default -f -a
>>> +=> save
>>
>> Isn't the new binary overwriting it?
>
> Let's say we are not using DFU and we want to flash u-boot.imx in the
> SD card of mx6qsabresd, for example. In this case, we simply do:
>
> dd if=u-boot.imx of=/dev/mmcblk0 bs=1k seek=1
>
> and the new u-boot.imx is flashed in the SD card, and the env vars are
> not touched.
>
> Same happens with DFU, so that's why I include the ' env default -f
> -a' in the instructions.
>
> Not sure if I understand the issue you are trying to describe.

Well this README is covering WaRP so we ought to cover WaRP specifics there.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: imx: Fix conflicting definition types of 'get_reset_cause'

2015-03-02 Thread Otavio Salvador
The common i.MX definition of 'get_reset_cause' function is non-static
so the overriden ones should follow it. This fixes following error:

,
|  arch/arm/imx-common/cpu.c:29:14: error: static declaration
|   of 'get_reset_cause' follows non-static declaration
|   static char *get_reset_cause(void)
`

The fix has been done in all i.MX based SoCs plus vf610.

Fixes [YOCTO: #7384].

Signed-off-by: Otavio Salvador 
---

 arch/arm/cpu/arm1136/mx31/generic.c   | 2 +-
 arch/arm/cpu/arm1136/mx35/generic.c   | 2 +-
 arch/arm/cpu/arm926ejs/mx25/generic.c | 2 +-
 arch/arm/cpu/armv7/vf610/generic.c| 2 +-
 arch/arm/imx-common/cpu.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/arm1136/mx31/generic.c 
b/arch/arm/cpu/arm1136/mx31/generic.c
index 060d46b..df8ebfc 100644
--- a/arch/arm/cpu/arm1136/mx31/generic.c
+++ b/arch/arm/cpu/arm1136/mx31/generic.c
@@ -180,7 +180,7 @@ u32 get_cpu_rev(void)
return srev | 0x8000;
 }
 
-static char *get_reset_cause(void)
+char *get_reset_cause(void)
 {
/* read RCSR register from CCM module */
struct clock_control_regs *ccm =
diff --git a/arch/arm/cpu/arm1136/mx35/generic.c 
b/arch/arm/cpu/arm1136/mx35/generic.c
index bc98edd..6dd8116 100644
--- a/arch/arm/cpu/arm1136/mx35/generic.c
+++ b/arch/arm/cpu/arm1136/mx35/generic.c
@@ -396,7 +396,7 @@ U_BOOT_CMD(
 );
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
-static char *get_reset_cause(void)
+char *get_reset_cause(void)
 {
/* read RCSR register from CCM module */
struct ccm_regs *ccm =
diff --git a/arch/arm/cpu/arm926ejs/mx25/generic.c 
b/arch/arm/cpu/arm926ejs/mx25/generic.c
index 8912098..9f37f4d 100644
--- a/arch/arm/cpu/arm926ejs/mx25/generic.c
+++ b/arch/arm/cpu/arm926ejs/mx25/generic.c
@@ -149,7 +149,7 @@ u32 get_cpu_rev(void)
 }
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
-static char *get_reset_cause(void)
+char *get_reset_cause(void)
 {
/* read RCSR register from CCM module */
struct ccm_regs *ccm =
diff --git a/arch/arm/cpu/armv7/vf610/generic.c 
b/arch/arm/cpu/armv7/vf610/generic.c
index 92aaad9..aea0c0d 100644
--- a/arch/arm/cpu/armv7/vf610/generic.c
+++ b/arch/arm/cpu/armv7/vf610/generic.c
@@ -258,7 +258,7 @@ void imx_get_mac_from_fuse(int dev_id, unsigned char *mac)
 #endif
 
 #if defined(CONFIG_DISPLAY_CPUINFO)
-static char *get_reset_cause(void)
+char *get_reset_cause(void)
 {
u32 cause;
struct src *src_regs = (struct src *)SRC_BASE_ADDR;
diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c
index 067d08f..b985f18 100644
--- a/arch/arm/imx-common/cpu.c
+++ b/arch/arm/imx-common/cpu.c
@@ -26,7 +26,7 @@
 
 static u32 reset_cause = -1;
 
-static char *get_reset_cause(void)
+char *get_reset_cause(void)
 {
u32 cause;
struct src *src_regs = (struct src *)SRC_BASE_ADDR;
-- 
2.1.4

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


Re: [U-Boot] [PATCH 09/14] mxs: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Marek Vasut
On Monday, March 02, 2015 at 06:14:33 PM, Fabio Estevam wrote:
> Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
> the console and hitting enter afterwards, causes a hang in the system
> because CONFIG_SYS_PBSIZE is not capable of storing the extra characters
> of the error message:
> "Unknown command '' - try 'help'".
> 
> Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to
> solve this problem.
> 
> Cc: Marek Vasut 
> Signed-off-by: Fabio Estevam 

Acked-by: Marek Vasut 

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


Re: [U-Boot] [PATCH 14/14] novena: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Marek Vasut
On Monday, March 02, 2015 at 06:14:38 PM, Fabio Estevam wrote:
> Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
> the console and hitting enter afterwards, causes a hang in the system
> because CONFIG_SYS_PBSIZE is not capable of storing the extra characters
> of the error message:
> "Unknown command '' - try 'help'".
> 
> Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to
> solve this problem.
> 
> Cc: Marek Vasut 
> Signed-off-by: Fabio Estevam 

Acked-by: Marek Vasut 

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


Re: [U-Boot] [PATCH v2] warp: Add a README file

2015-03-02 Thread Fabio Estevam
Hi Otavio,

On Mon, Mar 2, 2015 at 2:36 PM, Otavio Salvador  wrote:
>> +Use the default environment variables:
>> +
>> +=> env default -f -a
>> +=> save
>
> Isn't the new binary overwriting it?

Let's say we are not using DFU and we want to flash u-boot.imx in the
SD card of mx6qsabresd, for example. In this case, we simply do:

dd if=u-boot.imx of=/dev/mmcblk0 bs=1k seek=1

and the new u-boot.imx is flashed in the SD card, and the env vars are
not touched.

Same happens with DFU, so that's why I include the ' env default -f
-a' in the instructions.

Not sure if I understand the issue you are trying to describe.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [GIT PULL] Xilinx ZynqMP

2015-03-02 Thread Michal Simek
Hi Tom,

please consider to pull this Xilinx ZynqMP platform support to your tree.

Thanks,
Michal

The following changes since commit 1606b34aa50804227806971dbb6b82ea0bf81f55:

  Merge branch 'master' of git://git.denx.de/u-boot-fsl-qoriq (2015-02-25 
18:14:18 -0500)

are available in the git repository at:


  git://www.denx.de/git/u-boot-microblaze.git xnext/zynqmp

for you to fetch changes up to 84c7204bd18a0051a353c7a6f65a5666e1af9501:

  arm64: Add Xilinx ZynqMP support (2015-03-02 18:41:54 +0100)


Michal Simek (1):
  arm64: Add Xilinx ZynqMP support

 MAINTAINERS  |   6 ++
 arch/arm/Kconfig |   5 +
 arch/arm/cpu/armv8/Makefile  |   1 +
 arch/arm/cpu/armv8/zynqmp/Makefile   |   9 +
 arch/arm/cpu/armv8/zynqmp/clk.c  |  49 
+
 arch/arm/cpu/armv8/zynqmp/cpu.c  |  28 
 arch/arm/include/asm/arch-zynqmp/clk.h   |  13 +
 arch/arm/include/asm/arch-zynqmp/hardware.h  |  52 

 arch/arm/include/asm/arch-zynqmp/sys_proto.h |  15 +++
 board/xilinx/zynqmp/Kconfig  |  15 +++
 board/xilinx/zynqmp/MAINTAINERS  |   6 ++
 board/xilinx/zynqmp/Makefile |   8 
 board/xilinx/zynqmp/zynqmp.c |  90 
++
 configs/xilinx_zynqmp_defconfig  |  14 ++
 include/configs/xilinx_zynqmp.h  | 131 
+++
 15 files changed, 442 insertions(+)
 create mode 100644 arch/arm/cpu/armv8/zynqmp/Makefile
 create mode 100644 arch/arm/cpu/armv8/zynqmp/clk.c
 create mode 100644 arch/arm/cpu/armv8/zynqmp/cpu.c
 create mode 100644 arch/arm/include/asm/arch-zynqmp/clk.h
 create mode 100644 arch/arm/include/asm/arch-zynqmp/hardware.h
 create mode 100644 arch/arm/include/asm/arch-zynqmp/sys_proto.h
 create mode 100644 board/xilinx/zynqmp/Kconfig
 create mode 100644 board/xilinx/zynqmp/MAINTAINERS
 create mode 100644 board/xilinx/zynqmp/Makefile
 create mode 100644 board/xilinx/zynqmp/zynqmp.c
 create mode 100644 configs/xilinx_zynqmp_defconfig
 create mode 100644 include/configs/xilinx_zynqmp.h



-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




signature.asc
Description: OpenPGP digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] warp: Add a README file

2015-03-02 Thread Otavio Salvador
On Mon, Mar 2, 2015 at 12:57 PM, Fabio Estevam
 wrote:
> Provide instructions on how to upgrade U-boot in the eMMC.
>
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v1:
> - Use Boundary Device's tree for imx_usb_loader
> - Pass u-boot.imx as an argument of imx_usb
>
>  board/warp/README | 56 
> +++
>  1 file changed, 56 insertions(+)
>  create mode 100644 board/warp/README
>
> diff --git a/board/warp/README b/board/warp/README
> new file mode 100644
> index 000..d315140
> --- /dev/null
> +++ b/board/warp/README
> @@ -0,0 +1,56 @@
> +How to Update U-boot on Warp board
> +--
> +
> +Required software on the host PC:
> +
> +- imx_usb_loader: https://github.com/boundarydevices/imx_usb_loader
> +
> +- dfu-util: http://dfu-util.sourceforge.net/releases/
> +
> +Build U-boot for Warp:
> +
> +$ make mrproper
> +$ make warp_config
> +$ make
> +
> +This will generate the U-boot binary called u-boot.imx.
> +
> +Put warp board in USB download mode
> +
> +Connect a USB to serial adapter between the host PC and warp
> +
> +Connect a USB cable between the OTG warp port and the host PC
> +
> +Open a terminal program such as minicom
> +
> +Copy u-boot.imx to the imx_usb_loader folder.
> +
> +Load u-boot.imx via USB:
> +
> +$ sudo ./imx_usb u-boot.imx
> +
> +Then U-boot should start and its messages will appear in the console program.
> +
> +Use the default environment variables:
> +
> +=> env default -f -a
> +=> save

Isn't the new binary overwriting it?

> +Run the DFU command:
> +=> dfu 0 mmc 0
> +
> +Transfer u-boot.imx that will be flashed into the eMMC:
> +
> +$ sudo dfu-util -D u-boot.imx -a boot
> +
> +Then on the U-boot prompt the following message should be seen after a 
> succesful
> +upgrade:
> +
> +#DOWNLOAD ... OK
> +Ctrl+C to exit ...
> +
> +Remove power from the warp board.
> +
> +Put warp board into normal boot mode
> +
> +Power up the board and the new updated U-boot should boot from eMMC
> --
> 1.9.1
>



-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://code.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 03/14] mx6qarm2: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Jason Liu 
Signed-off-by: Fabio Estevam 
---
 include/configs/mx6qarm2.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx6qarm2.h b/include/configs/mx6qarm2.h
index 76cfef1..5412dd3 100644
--- a/include/configs/mx6qarm2.h
+++ b/include/configs/mx6qarm2.h
@@ -153,8 +153,6 @@
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256
 
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH] arm64: Add Xilinx ZynqMP support

2015-03-02 Thread Sören Brinkmann
On Mon, 2015-03-02 at 04:07PM +0100, Michal Simek wrote:
> On 03/02/2015 03:23 PM, Tom Rini wrote:
> > On Mon, Mar 02, 2015 at 09:24:45AM +0100, Michal Simek wrote:
> >> On 03/02/2015 08:32 AM, Michal Simek wrote:
> >>> On 02/27/2015 06:13 PM, Tom Rini wrote:
>  On Tue, Feb 24, 2015 at 09:02:09AM +0100, Michal Simek wrote:
> 
> > Add basic Xilinx ZynqMP arm64 support.
> > Serial and SD is supported.
> > It supports emulation platfrom ep108 and QEMU.
> >
> > Signed-off-by: Michal Simek 
>  [snip]
> > +/* Miscellaneous configurable options */
> > +#define CONFIG_SYS_LOAD_ADDR   0x800
> > +
> > +/* Initial environment variables */
> > +#define CONFIG_EXTRA_ENV_SETTINGS \
> > +   "ethaddr=00:0a:35:00:01:22\0" \
> 
>  No, you can't hard-code an ethaddr in.
> >>>
> >>> ah yeah.
> >>>
> 
> > +   "kernel_addr=0x20\0" \
> > +   "initrd_addr=0xa0\0" \
> > +   "initrd_size=0x200\0" \
> 
>  These are really close together.  And I imagine mirror the usual values
>  on 32bit platforms.  Maybe it's time to move them around a bit for more
>  space?
> >>>
> >>> Currently I haven't had any problem with these values but I just don't 
> >>> know
> >>> what will happen in future.
> > 
> > Right.  That's partly why I moved as much of the TI ARMv7 parts to the
> > Linux kernel defined limits a while back, people managed to bump into
> > overruns doing valid things.  I'd really like to see things default to
> > something closer to the defined limits to start with and avoid those
> > kind of problems a few years down the line.  8MB is fine for now but I
> > can see people running over that and going "why does my initrd boot
> > fail".
> 
> We will use FIT image and all these values won't be needed but
> they are need to be here.
> I have removed unused initrd_X in v2 because it is completely unused.

Well, I haven't used FIT images so far and don't see why I should. Can we
please put the initrd at the highest address amongst kernel, DT and
initrd? The initrd is most prone grow. My current one is beyond 100MB.
Let's just spread things out, there should be enough memory for this.

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


[U-Boot] [PATCH 14/14] novena: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Marek Vasut 
Signed-off-by: Fabio Estevam 
---
 include/configs/novena.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/novena.h b/include/configs/novena.h
index 074110c..3809c6c 100644
--- a/include/configs/novena.h
+++ b/include/configs/novena.h
@@ -58,9 +58,6 @@
 /* U-Boot general configurations */
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_SYS_CBSIZE  1024/* Console I/O buffer size */
-#define CONFIG_SYS_PBSIZE  \
-   (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
-   /* Print buffer size */
 #define CONFIG_SYS_MAXARGS 32  /* Max number of command args */
 #define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
/* Boot argument buffer size */
-- 
1.9.1

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


[U-Boot] [PATCH 05/14] mx51evk: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx51evk.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx51evk.h b/include/configs/mx51evk.h
index d6e8ec4..b0c9717 100644
--- a/include/configs/mx51evk.h
+++ b/include/configs/mx51evk.h
@@ -222,8 +222,6 @@
 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16  /* max number of command args */
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
 
-- 
1.9.1

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


[U-Boot] [PATCH 06/14] mx35pdk: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx35pdk.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx35pdk.h b/include/configs/mx35pdk.h
index a145f08..ae021a6 100644
--- a/include/configs/mx35pdk.h
+++ b/include/configs/mx35pdk.h
@@ -138,8 +138,6 @@
 
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16  /* max number of command args */
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
 
-- 
1.9.1

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


[U-Boot] [PATCH 13/14] warp: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Otavio Salvador 
Signed-off-by: Fabio Estevam 
---
 include/configs/warp.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/warp.h b/include/configs/warp.h
index babcda5..e851da0 100644
--- a/include/configs/warp.h
+++ b/include/configs/warp.h
@@ -81,9 +81,6 @@
 #define CONFIG_HW_WATCHDOG
 #define CONFIG_IMX_WATCHDOG
 #define CONFIG_WATCHDOG_TIMEOUT_MSECS 3 /* 30s */
-
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


[U-Boot] [PATCH 12/14] nitrogen6x: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Eric Nelson 
Signed-off-by: Fabio Estevam 
---
 include/configs/nitrogen6x.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/nitrogen6x.h b/include/configs/nitrogen6x.h
index 6d379ed..8ef4b73 100644
--- a/include/configs/nitrogen6x.h
+++ b/include/configs/nitrogen6x.h
@@ -325,9 +325,6 @@
 #define CONFIG_SYS_PROMPT "U-Boot > "
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE 1024
-
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS48
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


[U-Boot] [PATCH 01/14] mx6sxsabresd: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx6sxsabresd.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx6sxsabresd.h b/include/configs/mx6sxsabresd.h
index a290129..a29d62f 100644
--- a/include/configs/mx6sxsabresd.h
+++ b/include/configs/mx6sxsabresd.h
@@ -134,8 +134,6 @@
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  1024
 
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 256
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


[U-Boot] [PATCH 10/14] wandboard: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Signed-off-by: Fabio Estevam 
---
 include/configs/wandboard.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/wandboard.h b/include/configs/wandboard.h
index 117d1f7..b586803 100644
--- a/include/configs/wandboard.h
+++ b/include/configs/wandboard.h
@@ -249,9 +249,6 @@
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256
-
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


[U-Boot] [PATCH 11/14] hummingboard: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Signed-off-by: Fabio Estevam 
---
 include/configs/hummingboard.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/hummingboard.h b/include/configs/hummingboard.h
index 34dbdce..973f2c5 100644
--- a/include/configs/hummingboard.h
+++ b/include/configs/hummingboard.h
@@ -185,9 +185,6 @@
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  1024
-
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


[U-Boot] [PATCH 08/14] mx25pdk: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Signed-off-by: Fabio Estevam 
---
 include/configs/mx25pdk.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
index c02e29b..bfbfc68 100644
--- a/include/configs/mx25pdk.h
+++ b/include/configs/mx25pdk.h
@@ -229,8 +229,6 @@
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_AUTO_COMPLETE
 
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


[U-Boot] [PATCH 09/14] mxs: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Marek Vasut 
Signed-off-by: Fabio Estevam 
---
 include/configs/mxs.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/mxs.h b/include/configs/mxs.h
index dea8227..38b1e93 100644
--- a/include/configs/mxs.h
+++ b/include/configs/mxs.h
@@ -94,9 +94,6 @@
 /* U-Boot general configuration */
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_SYS_CBSIZE  1024/* Console I/O buffer size */
-#define CONFIG_SYS_PBSIZE  \
-   (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
-   /* Print buffer size */
 #define CONFIG_SYS_MAXARGS 32  /* Max number of command args */
 #define CONFIG_SYS_BARGSIZECONFIG_SYS_CBSIZE
/* Boot argument buffer size */
-- 
1.9.1

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


[U-Boot] [PATCH 04/14] mx53loco: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Jason Liu 
Signed-off-by: Fabio Estevam 
---
 include/configs/mx53loco.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
index 42bc3c8..3551e02 100644
--- a/include/configs/mx53loco.h
+++ b/include/configs/mx53loco.h
@@ -182,8 +182,6 @@
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  512 /* Console I/O Buffer Size */
 
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16  /* max number of command args */
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE /* Boot Argument Buffer Size */
 
-- 
1.9.1

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


[U-Boot] [PATCH 07/14] mx31pdk: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Magnus Lilja 
Signed-off-by: Fabio Estevam 
---
 include/configs/mx31pdk.h | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 2a3e53c..1282a6e 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -121,9 +121,6 @@
  */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
 #define CONFIG_SYS_CBSIZE  256 /* Console I/O Buffer Size */
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE  (CONFIG_SYS_CBSIZE + \
-   sizeof(CONFIG_SYS_PROMPT)+16)
 /* max number of command args */
 #define CONFIG_SYS_MAXARGS 16
 /* Boot Argument Buffer Size */
-- 
1.9.1

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


[U-Boot] [PATCH 02/14] mx6slevk: Use the default CONFIG_SYS_PBSIZE

2015-03-02 Thread Fabio Estevam
Entering the maximum number of characters defined by CONFIG_SYS_CBSIZE into
the console and hitting enter afterwards, causes a hang in the system because
CONFIG_SYS_PBSIZE is not capable of storing the extra characters of the error
message:
"Unknown command '' - try 'help'".

Use the default CONFIG_SYS_PBSIZE definition from config_fallbacks.h to solve
this problem.

Cc: Jason Liu 
Signed-off-by: Fabio Estevam 
---
 include/configs/mx6slevk.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/configs/mx6slevk.h b/include/configs/mx6slevk.h
index 1221418..21c654b 100644
--- a/include/configs/mx6slevk.h
+++ b/include/configs/mx6slevk.h
@@ -169,8 +169,6 @@
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_CBSIZE  256
 
-/* Print Buffer Size */
-#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_MAXARGS 16
 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH 4/6] config_distro_bootcmd.h: Add shared block definition for the host interface

2015-03-02 Thread Stephen Warren

On 02/28/2015 07:14 AM, Simon Glass wrote:

+Stephen for real this time

Hi Sjoerd,

On 28 February 2015 at 07:05, Sjoerd Simons
 wrote:

On Fri, 2015-02-20 at 12:23 -0700, Simon Glass wrote:

+Stephen who knows more about this stuff

On 19 February 2015 at 15:41, Sjoerd Simons
 wrote:

Define the common shared block environment for the host interface in
preperation for the sandbox build to use config_distro_bootcmd.

Signed-off-by: Sjoerd Simons 
---
  include/config_distro_bootcmd.h | 13 +
  1 file changed, 13 insertions(+)

diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 07a0b3b..ff0e3a8 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -32,6 +32,18 @@
  #define BOOTENV_DEV_NAME_BLKDEV(devtypeu, devtypel, instance) \
 #devtypel #instance " "

+#ifdef CONFIG_SANDBOX
+#define BOOTENV_SHARED_HOSTBOOTENV_SHARED_BLKDEV(host)
+#define BOOTENV_DEV_HOST   BOOTENV_DEV_BLKDEV
+#define BOOTENV_DEV_NAME_HOST  BOOTENV_DEV_NAME_BLKDEV
+#else
+#define BOOTENV_SHARED_HOST
+#define BOOTENV_DEV_HOST \
+   BOOT_TARGET_DEVICES_references_HOST_without_CONFIG_SANDBOX
+#define BOOTENV_DEV_NAME_HOST \


Can we use upper case in #defines?


The reason for this is that it is consistent with all other block device
blocks in that file e.g:

#define BOOTENV_DEV_SATA \
BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA

So i'd prefer to to keep it that way. Btw, note that this is used for
compile time error reporting rather then something you'd refer to in
code.


OK I see.


Yes, in this case that mixed-case variable name is essentially an error 
message to the user. The mixed case hopefully makes it more legible 
since only other variable names are in upper case, and the rest of the 
warning text is lower case. We can't use e.g. #error here, since this 
error can only be detected in the middle of a macro expansion rather 
than via some top-level singleton #if/#ifdef check.

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


Re: [U-Boot] [PATCH v2 0/4] various fixes for apalis/colibri_t30

2015-03-02 Thread Stephen Warren

On 02/28/2015 06:05 PM, Marcel Ziswiler wrote:

The following is a set of various fixes for Toradex Apalis and Colibri
T30.


The series,
Acked-by: Stephen Warren 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCHv2 18/20] arm: socfpga: spl: add board_init_f to SPL

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Remap SDRAM to 0x0 in board_init_f().

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/spl.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index 31ac789..21023c2 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -6,6 +6,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -20,6 +21,9 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static struct pl310_regs *const pl310 =
+   (struct pl310_regs *)CONFIG_SYS_PL310_BASE;
+
 #define MAIN_VCO_BASE (\
(CONFIG_HPS_MAINPLLGRP_VCO_DENOM << \
CLKMGR_MAINPLLGRP_VCO_DENOM_OFFSET) |   \
@@ -45,6 +49,16 @@ DECLARE_GLOBAL_DATA_PTR;
CLKMGR_SDRPLLGRP_VCO_NUMER_OFFSET)  \
)
 
+void board_init_f(ulong dummy)
+{
+   memset(__bss_start, 0, __bss_end - __bss_start);
+   gd = &gdata;
+
+   writel(0x1, &pl310->pl310_addr_filter_start);
+
+   board_init_r(NULL, 0);
+}
+
 u32 spl_boot_device(void)
 {
return BOOT_DEVICE_RAM;
-- 
2.2.1

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


[U-Boot] [PATCHv2 11/20] arm: socfpga: spl: Add s_init

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Clear OCRAM's ECC.

Signed-off-by: Dinh Nguyen 
---
v2: remove redundant code that is already in arch_early_init_r
---
 arch/arm/cpu/armv7/socfpga/Makefile |  4 ++--
 arch/arm/cpu/armv7/socfpga/s_init.c | 37 +
 2 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/socfpga/s_init.c

diff --git a/arch/arm/cpu/armv7/socfpga/Makefile 
b/arch/arm/cpu/armv7/socfpga/Makefile
index 8b6e108..ee0af9b 100644
--- a/arch/arm/cpu/armv7/socfpga/Makefile
+++ b/arch/arm/cpu/armv7/socfpga/Makefile
@@ -8,6 +8,6 @@
 #
 
 obj-y  := lowlevel_init.o
-obj-y  += misc.o timer.o reset_manager.o system_manager.o clock_manager.o \
-  fpga_manager.o
+obj-y  += s_init.o misc.o timer.o reset_manager.o system_manager.o \
+  clock_manager.o fpga_manager.o
 obj-$(CONFIG_SPL_BUILD) += spl.o freeze_controller.o scan_manager.o
diff --git a/arch/arm/cpu/armv7/socfpga/s_init.c 
b/arch/arm/cpu/armv7/socfpga/s_init.c
new file mode 100644
index 000..bb159c6
--- /dev/null
+++ b/arch/arm/cpu/armv7/socfpga/s_init.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2014 Altera Corporation 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * First C function to initialize the critical hardware early
+ */
+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);
+#endif /* CONFIG_SPL_BUILD */
+}
-- 
2.2.1

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


[U-Boot] [PATCHv2 14/20] arm: socfpga: add sdram stack to SPL

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Add a stack in the SDRAM to be able to use SPL_FAT_LOAD in later
stages of the SPL.

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 7 +++
 include/configs/socfpga_common.h  | 1 +
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds 
b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index 7c7f59c..739f3f1 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -51,4 +51,11 @@ SECTIONS
. = ALIGN(8);
__stack_start = .;
} >.sram
+
+   .sdram_stack :
+   {
+   __sdram_stack_end = .;
+   . = . + CONFIG_SPL_SDRAM_STACK_SIZE;
+   __sdram_stack_start = .;
+   } >.sdram
 }
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 042c65f..43f20c9 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -312,6 +312,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
  * Stack setup
  */
 #define CONFIG_SPL_STACK   CONFIG_SYS_INIT_SP_ADDR
+#define CONFIG_SPL_SDRAM_STACK_SIZE(128 * 1024)
 
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_PARTITIONS
-- 
2.2.1

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


[U-Boot] [PATCHv2 05/20] arm: socfpga: spl: enable sdram, timer and uart

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Add the calls in the spl_board_init to enable SDRAM, timer, and UART.

Signed-off-by: Dinh Nguyen 
Acked-by: Marek Vasut 
---
 arch/arm/cpu/armv7/socfpga/spl.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index bd9f338..b123336 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -145,6 +145,10 @@ void spl_board_init(void)
/* freeze all IO banks */
sys_mgr_frzctrl_freeze_req();
 
+   socfpga_sdram_enable();
+   socfpga_uart0_enable();
+   socfpga_osc1timer_enable();
+
debug("Reconfigure Clock Manager\n");
/* reconfigure the PLLs */
cm_basic_init(&cm_default_cfg);
-- 
2.2.1

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


[U-Boot] [PATCHv2 09/20] arm: socfpga: spl: printout sdram size

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
---
v2: Add a debug print
---
 arch/arm/cpu/armv7/socfpga/spl.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index 71021f0..ea4a1fb 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -55,6 +55,7 @@ u32 spl_boot_device(void)
  */
 void spl_board_init(void)
 {
+   unsigned long sdram_size;
 #ifndef CONFIG_SOCFPGA_VIRTUAL_TARGET
cm_config_t cm_default_cfg = {
/* main group */
@@ -187,4 +188,7 @@ void spl_board_init(void)
puts("SDRAM calibration failed!\n");
hang();
}
+
+   sdram_size = sdram_calculate_size();
+   debug("SDRAM: %ld MiB\n", (sdram_size >> 20));
 }
-- 
2.2.1

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


[U-Boot] [PATCHv2 19/20] arm: socfpga: spl: update pll_config for dev kit

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

This sets the CPU clocks to 925MHz and DDR to 400MHz.

Signed-off-by: Dinh Nguyen 
---
 board/altera/socfpga/pll_config.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/board/altera/socfpga/pll_config.h 
b/board/altera/socfpga/pll_config.h
index f0f59a9..3992ff7 100644
--- a/board/altera/socfpga/pll_config.h
+++ b/board/altera/socfpga/pll_config.h
@@ -12,13 +12,13 @@
 /* PLL configuration data */
 /* Main PLL */
 #define CONFIG_HPS_MAINPLLGRP_VCO_DENOM(0)
-#define CONFIG_HPS_MAINPLLGRP_VCO_NUMER(63)
+#define CONFIG_HPS_MAINPLLGRP_VCO_NUMER(73)
 #define CONFIG_HPS_MAINPLLGRP_MPUCLK_CNT   (0)
 #define CONFIG_HPS_MAINPLLGRP_MAINCLK_CNT  (0)
 #define CONFIG_HPS_MAINPLLGRP_DBGATCLK_CNT (0)
-#define CONFIG_HPS_MAINPLLGRP_MAINQSPICLK_CNT  (3)
-#define CONFIG_HPS_MAINPLLGRP_MAINNANDSDMMCCLK_CNT (3)
-#define CONFIG_HPS_MAINPLLGRP_CFGS2FUSER0CLK_CNT   (12)
+#define CONFIG_HPS_MAINPLLGRP_MAINQSPICLK_CNT  (4)
+#define CONFIG_HPS_MAINPLLGRP_MAINNANDSDMMCCLK_CNT (0)
+#define CONFIG_HPS_MAINPLLGRP_CFGS2FUSER0CLK_CNT   (14)
 #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L3MPCLK  (1)
 #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L3SPCLK  (1)
 #define CONFIG_HPS_MAINPLLGRP_MAINDIV_L4MPCLK  (1)
-- 
2.2.1

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


[U-Boot] [PATCHv2 20/20] arm: socfpga: remove the need to map sdram in arch_early_init

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Since we are already mapping sdram 0x0 in board_init_f, we can remove it
here.

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/misc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/socfpga/misc.c 
b/arch/arm/cpu/armv7/socfpga/misc.c
index 7873c38..3cee6ff 100644
--- a/arch/arm/cpu/armv7/socfpga/misc.c
+++ b/arch/arm/cpu/armv7/socfpga/misc.c
@@ -205,9 +205,6 @@ int arch_early_init_r(void)
/* Configure the L2 controller to make SDRAM start at 0 */
 #ifdef CONFIG_SOCFPGA_VIRTUAL_TARGET
writel(0x2, &nic301_regs->remap);
-#else
-   writel(0x1, &nic301_regs->remap);   /* remap.mpuzero */
-   writel(0x1, &pl310->pl310_addr_filter_start);
 #endif
 
/* Add device descriptor to FPGA device table */
-- 
2.2.1

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


[U-Boot] [PATCHv2 17/20] arm: socfpga: spl: Add SDRAM check

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/spl.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index ea4a1fb..31ac789 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -191,4 +191,12 @@ void spl_board_init(void)
 
sdram_size = sdram_calculate_size();
debug("SDRAM: %ld MiB\n", (sdram_size >> 20));
+
+   /* Sanity check ensure correct SDRAM size specified */
+   puts("SDRAM: Ensuring specified SDRAM size is correct ...");
+   if (get_ram_size(0, sdram_size) != sdram_size) {
+   puts("failed\n");
+   hang();
+   }
+   puts("passed\n");
 }
-- 
2.2.1

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


[U-Boot] [PATCHv2 16/20] arm: socfpga: spl: add a malloc section in sram

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 7 +++
 include/configs/socfpga_common.h  | 1 +
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds 
b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index 739f3f1..f87e951 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -45,6 +45,13 @@ SECTIONS
__bss_end = .;
} >.sram
 
+   .malloc :
+   {
+   . = . + CONFIG_SPL_MALLOC_SIZE;
+   . = ALIGN(8);
+   __malloc_start = .;
+   } >.sram
+
.stack :
{
. = . + CONFIG_SPL_STACK_SIZE;
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 31c8961..5d1343a 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -296,6 +296,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SYS_SPL_MALLOC_SIZE 256
 #define CONFIG_SPL_MAX_SIZE(64 * 1024)
 #define CONFIG_SPL_STACK_SIZE  0x1000
+#define CONFIG_SPL_MALLOC_SIZE (5 * 1024)
 
 #define CHUNKSZ_CRC32  (1 * 1024)  /* FIXME: ewww */
 #define CONFIG_CRC32_VERIFY
-- 
2.2.1

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


[U-Boot] [PATCHv2 15/20] arm: socfpga: spl: adjust SPL_MALLOC_SIZE to 256

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
---
 include/configs/socfpga_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 43f20c9..31c8961 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -293,7 +293,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPL_RAM_DEVICE
 #define CONFIG_SPL_TEXT_BASE   CONFIG_SYS_INIT_RAM_ADDR
 #define CONFIG_SYS_SPL_MALLOC_STARTCONFIG_SYS_INIT_SP_ADDR
-#define CONFIG_SYS_SPL_MALLOC_SIZE (5 * 1024)
+#define CONFIG_SYS_SPL_MALLOC_SIZE 256
 #define CONFIG_SPL_MAX_SIZE(64 * 1024)
 #define CONFIG_SPL_STACK_SIZE  0x1000
 
-- 
2.2.1

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


[U-Boot] [PATCHv2 10/20] arm: socfpga: spl: Use common lowlevel_init

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

For SoCFGPA, use the common ARMv7 lowlevel_init.

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/Makefile| 2 +-
 arch/arm/cpu/armv7/socfpga/lowlevel_init.S | 4 
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index b228ed6..924bcf4 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -12,7 +12,7 @@ obj-y += cache_v7.o
 obj-y  += cpu.o
 obj-y  += syslib.o
 
-ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI),)
+ifneq 
($(CONFIG_AM43XX)$(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONFIG_MX6)$(CONFIG_TI81XX)$(CONFIG_AT91FAMILY)$(CONFIG_SUNXI)$(CONFIG_SOCFPGA),)
 ifneq ($(CONFIG_SKIP_LOWLEVEL_INIT),y)
 obj-y  += lowlevel_init.o
 endif
diff --git a/arch/arm/cpu/armv7/socfpga/lowlevel_init.S 
b/arch/arm/cpu/armv7/socfpga/lowlevel_init.S
index afed773..723508c 100644
--- a/arch/arm/cpu/armv7/socfpga/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/socfpga/lowlevel_init.S
@@ -7,10 +7,6 @@
 #include 
 #include 
 
-/* Set up the platform, once the cpu has been initialized */
-.globl lowlevel_init
-lowlevel_init:
-
/* Remap */
 #ifdef CONFIG_SPL_BUILD
/*
-- 
2.2.1

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


[U-Boot] [PATCHv2 13/20] arm: socfpga: spl: add CONFIG_SPL_STACK to socfpga_common.h

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
---
 include/configs/socfpga_common.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index ed83cb8..042c65f 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -308,6 +308,11 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPL_WATCHDOG_SUPPORT
 #define CONFIG_SPL_SERIAL_SUPPORT
 
+/*
+ * Stack setup
+ */
+#define CONFIG_SPL_STACK   CONFIG_SYS_INIT_SP_ADDR
+
 #ifdef CONFIG_SPL_BUILD
 #undef CONFIG_PARTITIONS
 #endif
-- 
2.2.1

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


[U-Boot] [PATCHv2 07/20] arm: socfpga: spl: allow bootrom to enable IOs after warm reset

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
Acked-by: Marek Vasut 
---
 arch/arm/cpu/armv7/socfpga/spl.c   | 3 +++
 arch/arm/cpu/armv7/socfpga/system_manager.c| 9 +
 arch/arm/include/asm/arch-socfpga/system_manager.h | 1 +
 3 files changed, 13 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index bc6f8dd..9ef2983 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -155,6 +155,9 @@ void spl_board_init(void)
/* reconfigure the PLLs */
cm_basic_init(&cm_default_cfg);
 
+   /* Enable bootrom to configure IOs. */
+   sysmgr_enable_warmrstcfgio();
+
/* configure the IOCSR / IO buffer settings */
if (scan_mgr_configure_iocsr())
hang();
diff --git a/arch/arm/cpu/armv7/socfpga/system_manager.c 
b/arch/arm/cpu/armv7/socfpga/system_manager.c
index 11f7bad..8126e0d 100644
--- a/arch/arm/cpu/armv7/socfpga/system_manager.c
+++ b/arch/arm/cpu/armv7/socfpga/system_manager.c
@@ -66,3 +66,12 @@ void sysmgr_pinmux_init(void)
 
populate_sysmgr_fpgaintf_module();
 }
+
+/*
+ * This bit allows the bootrom to configure the IOs after a warm reset.
+ */
+void sysmgr_enable_warmrstcfgio(void)
+{
+   setbits_le32(&sysmgr_regs->romcodegrp_ctrl,
+SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO);
+}
diff --git a/arch/arm/include/asm/arch-socfpga/system_manager.h 
b/arch/arm/include/asm/arch-socfpga/system_manager.h
index 071ec4f..51d9815 100644
--- a/arch/arm/include/asm/arch-socfpga/system_manager.h
+++ b/arch/arm/include/asm/arch-socfpga/system_manager.h
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 void sysmgr_pinmux_init(void);
+void sysmgr_enable_warmrstcfgio(void);
 
 /* declaration for handoff table type */
 extern unsigned long sys_mgr_init_table[CONFIG_HPS_PINMUX_NUM];
-- 
2.2.1

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


[U-Boot] [PATCHv2 06/20] arm: socfpga: spl: Add call to timer_init

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/spl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index b123336..bc6f8dd 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -149,6 +149,8 @@ void spl_board_init(void)
socfpga_uart0_enable();
socfpga_osc1timer_enable();
 
+   timer_init();
+
debug("Reconfigure Clock Manager\n");
/* reconfigure the PLLs */
cm_basic_init(&cm_default_cfg);
-- 
2.2.1

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


[U-Boot] [PATCHv2 12/20] arm: socfpga: spl: add the stack in OCRAM

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Allocate a stack in the OCRAM for the SPL to use.

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 7 +++
 include/configs/socfpga_common.h  | 1 +
 2 files changed, 8 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds 
b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index 730d154..7c7f59c 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -44,4 +44,11 @@ SECTIONS
. = ALIGN(4);
__bss_end = .;
} >.sram
+
+   .stack :
+   {
+   . = . + CONFIG_SPL_STACK_SIZE;
+   . = ALIGN(8);
+   __stack_start = .;
+   } >.sram
 }
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index d449a78..ed83cb8 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -295,6 +295,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SYS_SPL_MALLOC_STARTCONFIG_SYS_INIT_SP_ADDR
 #define CONFIG_SYS_SPL_MALLOC_SIZE (5 * 1024)
 #define CONFIG_SPL_MAX_SIZE(64 * 1024)
+#define CONFIG_SPL_STACK_SIZE  0x1000
 
 #define CHUNKSZ_CRC32  (1 * 1024)  /* FIXME: ewww */
 #define CONFIG_CRC32_VERIFY
-- 
2.2.1

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


[U-Boot] [PATCHv2 08/20] arm: socfpga: spl: add sdram init and calibration

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Add a call to checkboard along with sdram intilialization and calibration.

Signed-off-by: Dinh Nguyen 
---
v2: Add a fail message
---
 arch/arm/cpu/armv7/socfpga/spl.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/spl.c b/arch/arm/cpu/armv7/socfpga/spl.c
index 9ef2983..71021f0 100644
--- a/arch/arm/cpu/armv7/socfpga/spl.c
+++ b/arch/arm/cpu/armv7/socfpga/spl.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -175,4 +176,15 @@ void spl_board_init(void)
 
/* enable console uart printing */
preloader_console_init();
+
+   if (sdram_mmr_init_full(0x) != 0) {
+   puts("SDRAM init failed\n");
+   hang();
+   }
+   puts("SDRAM: Calibrating PHY\n");
+   /* SDRAM calibration */
+   if (sdram_calibration_full() == 0) {
+   puts("SDRAM calibration failed!\n");
+   hang();
+   }
 }
-- 
2.2.1

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


[U-Boot] [PATCHv2 03/20] arm: socfpga: spl: put SPL in sram

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Update SPL linker file to use SRAM.

Signed-off-by: Dinh Nguyen 
Acked-by: Pavel Machek 
---
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds 
b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index a868a36..730d154 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -21,13 +21,13 @@ SECTIONS
*(.vectors)
arch/arm/cpu/armv7/start.o  (.text*)
*(.text*)
-   } >.sdram
+   } >.sram
 
. = ALIGN(4);
-   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } >.sdram
+   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } >.sram
 
. = ALIGN(4);
-   .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sdram
+   .data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
 
. = ALIGN(4);
__image_copy_end = .;
@@ -43,5 +43,5 @@ SECTIONS
*(.bss*)
. = ALIGN(4);
__bss_end = .;
-   } >.sdram
+   } >.sram
 }
-- 
2.2.1

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


[U-Boot] [PATCHv2 04/20] arm: socfpga: add functions to bring sdram, timer, and uart out of reset

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

These functions will be needed for use by the SPL for enabling the
console and sdram initialization.

Signed-off-by: Dinh Nguyen 
Acked-by: Marek Vasut 
Acked-by: Pavel Machek 
---
 arch/arm/cpu/armv7/socfpga/reset_manager.c| 24 +++
 arch/arm/include/asm/arch-socfpga/reset_manager.h |  6 ++
 2 files changed, 30 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/reset_manager.c 
b/arch/arm/cpu/armv7/socfpga/reset_manager.c
index 25921e7..45b352b 100644
--- a/arch/arm/cpu/armv7/socfpga/reset_manager.c
+++ b/arch/arm/cpu/armv7/socfpga/reset_manager.c
@@ -113,3 +113,27 @@ void socfpga_spim_enable(void)
clrbits_le32(reset, (1 << RSTMGR_PERMODRST_SPIM0_LSB) |
 (1 << RSTMGR_PERMODRST_SPIM1_LSB));
 }
+
+/* Bring UART0 out of reset. */
+void socfpga_uart0_enable(void)
+{
+   const void *reset = &reset_manager_base->per_mod_reset;
+
+   clrbits_le32(reset, 1 << RSTMGR_PERMODRST_UART0_LSB);
+}
+
+/* Bring SDRAM controller out of reset. */
+void socfpga_sdram_enable(void)
+{
+   const void *reset = &reset_manager_base->per_mod_reset;
+
+   clrbits_le32(reset, 1 << RSTMGR_PERMODRST_SDR_LSB);
+}
+
+/* Bring OSC1 timer out of reset. */
+void socfpga_osc1timer_enable(void)
+{
+   const void *reset = &reset_manager_base->per_mod_reset;
+
+   clrbits_le32(reset, 1 << RSTMGR_PERMODRST_OSC1TIMER0_LSB);
+}
diff --git a/arch/arm/include/asm/arch-socfpga/reset_manager.h 
b/arch/arm/include/asm/arch-socfpga/reset_manager.h
index 034135b..d63a285 100644
--- a/arch/arm/include/asm/arch-socfpga/reset_manager.h
+++ b/arch/arm/include/asm/arch-socfpga/reset_manager.h
@@ -15,6 +15,9 @@ void socfpga_bridges_reset(int enable);
 void socfpga_emac_reset(int enable);
 void socfpga_watchdog_reset(void);
 void socfpga_spim_enable(void);
+void socfpga_uart0_enable(void);
+void socfpga_sdram_enable(void);
+void socfpga_osc1timer_enable(void);
 
 struct socfpga_reset_manager {
u32 status;
@@ -36,7 +39,10 @@ struct socfpga_reset_manager {
 #define RSTMGR_PERMODRST_EMAC0_LSB 0
 #define RSTMGR_PERMODRST_EMAC1_LSB 1
 #define RSTMGR_PERMODRST_L4WD0_LSB 6
+#define RSTMGR_PERMODRST_OSC1TIMER0_LSB8
+#define RSTMGR_PERMODRST_UART0_LSB 16
 #define RSTMGR_PERMODRST_SPIM0_LSB 18
 #define RSTMGR_PERMODRST_SPIM1_LSB 19
+#define RSTMGR_PERMODRST_SDR_LSB   29
 
 #endif /* _RESET_MANAGER_H_ */
-- 
2.2.1

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


[U-Boot] [PATCHv2 00/20] Add SPL support for SoCFPGA

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Hello,

This is v2 of the patchset that adds all the SPL code that is necessary to
support the SoCFPGA platform. For v2, here are the changes:

- SDRAM - further clean and addressing all comments. Simplified to only support
  DDR3, FULLRATE, and Hard PHY.
- SDRAM - Moved to drivers/ddr/altera
- Move extra code that maps SDRAM to 0x0 in board_init_f

I have pushed a branch to git://git.rocketboards.org/u-boot-socfpga-next.git
socfpga_for_next_spl_v2 for testing and reviewing.

Rebased to 2015.04-rc2.

Thanks,

Dinh Nguyen (20):
  arm: socfpga: spl: Add main sdram code
  arm: socfpga: spl: Add SRAM section
  arm: socfpga: spl: put SPL in sram
  arm: socfpga: add functions to bring sdram, timer, and uart out of
reset
  arm: socfpga: spl: enable sdram, timer and uart
  arm: socfpga: spl: Add call to timer_init
  arm: socfpga: spl: allow bootrom to enable IOs after warm reset
  arm: socfpga: spl: add sdram init and calibration
  arm: socfpga: spl: printout sdram size
  arm: socfpga: spl: Use common lowlevel_init
  arm: socfpga: spl: Add s_init
  arm: socfpga: spl: add the stack in OCRAM
  arm: socfpga: spl: add CONFIG_SPL_STACK to socfpga_common.h
  arm: socfpga: add sdram stack to SPL
  arm: socfpga: spl: adjust SPL_MALLOC_SIZE to 256
  arm: socfpga: spl: add a malloc section in sram
  arm: socfpga: spl: Add SDRAM check
  arm: socfpga: spl: add board_init_f to SPL
  arm: socfpga: spl: update pll_config for dev kit
  arm: socfpga: remove the need to map sdram in arch_early_init

 Makefile   |1 +
 arch/arm/cpu/armv7/Makefile|2 +-
 arch/arm/cpu/armv7/socfpga/Makefile|4 +-
 arch/arm/cpu/armv7/socfpga/lowlevel_init.S |4 -
 arch/arm/cpu/armv7/socfpga/misc.c  |3 -
 arch/arm/cpu/armv7/socfpga/reset_manager.c |   24 +
 arch/arm/cpu/armv7/socfpga/s_init.c|   37 +
 arch/arm/cpu/armv7/socfpga/spl.c   |   47 +
 arch/arm/cpu/armv7/socfpga/system_manager.c|9 +
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds  |   29 +-
 arch/arm/include/asm/arch-socfpga/reset_manager.h  |6 +
 arch/arm/include/asm/arch-socfpga/sdram.h  |  434 +++
 arch/arm/include/asm/arch-socfpga/sdram_config.h   |  100 +
 arch/arm/include/asm/arch-socfpga/system_manager.h |1 +
 board/altera/socfpga/pll_config.h  |8 +-
 drivers/ddr/altera/Makefile|   12 +
 drivers/ddr/altera/sdram.c | 1307 +++
 drivers/ddr/altera/sequencer.c | 3972 
 drivers/ddr/altera/sequencer.h |  359 ++
 drivers/ddr/altera/sequencer_auto.h|  216 ++
 drivers/ddr/altera/sequencer_auto_ac_init.c|   85 +
 drivers/ddr/altera/sequencer_auto_inst_init.c  |  270 ++
 drivers/ddr/altera/sequencer_defines.h |  121 +
 include/configs/socfpga_common.h   |   11 +-
 include/configs/socfpga_cyclone5.h |1 +
 scripts/Makefile.spl   |1 +
 26 files changed, 7046 insertions(+), 18 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/socfpga/s_init.c
 create mode 100644 arch/arm/include/asm/arch-socfpga/sdram.h
 create mode 100644 arch/arm/include/asm/arch-socfpga/sdram_config.h
 create mode 100644 drivers/ddr/altera/Makefile
 create mode 100644 drivers/ddr/altera/sdram.c
 create mode 100644 drivers/ddr/altera/sequencer.c
 create mode 100644 drivers/ddr/altera/sequencer.h
 create mode 100644 drivers/ddr/altera/sequencer_auto.h
 create mode 100644 drivers/ddr/altera/sequencer_auto_ac_init.c
 create mode 100644 drivers/ddr/altera/sequencer_auto_inst_init.c
 create mode 100644 drivers/ddr/altera/sequencer_defines.h

-- 
2.2.1

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


[U-Boot] [PATCHv2 02/20] arm: socfpga: spl: Add SRAM section

2015-03-02 Thread dinguyen
From: Dinh Nguyen 

Add a section of SRAM to the SPL linker file.

Signed-off-by: Dinh Nguyen 
---
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds | 2 ++
 include/configs/socfpga_common.h  | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds 
b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index 569fa41..a868a36 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -5,6 +5,8 @@
  */
 
 MEMORY { .sdram : ORIGIN = (0), LENGTH = (0x) }
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+   LENGTH = CONFIG_SPL_MAX_SIZE }
 
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index ee227fe..d449a78 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -294,6 +294,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_SPL_TEXT_BASE   CONFIG_SYS_INIT_RAM_ADDR
 #define CONFIG_SYS_SPL_MALLOC_STARTCONFIG_SYS_INIT_SP_ADDR
 #define CONFIG_SYS_SPL_MALLOC_SIZE (5 * 1024)
+#define CONFIG_SPL_MAX_SIZE(64 * 1024)
 
 #define CHUNKSZ_CRC32  (1 * 1024)  /* FIXME: ewww */
 #define CONFIG_CRC32_VERIFY
-- 
2.2.1

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


Re: [U-Boot] [PATCH] kconfig: remove unneeded U-Boot extension code

2015-03-02 Thread Simon Glass
On 27 February 2015 at 08:45, Masahiro Yamada  wrote:
> This code was introduced to support the multiple .config
> configuration in U-Boot.  We do not need it any more.
>
> Signed-off-by: Masahiro Yamada 
> ---
>
>  scripts/kconfig/confdata.c | 8 
>  1 file changed, 8 deletions(-)

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


Re: [U-Boot] [PATCH 2/5] arm: exynos: add display clocks for Exynos5800

2015-03-02 Thread Simon Glass
Hi Ajay,

On 2 March 2015 at 09:07, Ajay kumar  wrote:
> Hi Simon,
>
> On Mon, Mar 2, 2015 at 7:53 AM, Simon Glass  wrote:
>> Hi Ajay,
>>
>> On 8 December 2014 at 15:40, Simon Glass  wrote:
>>> Hi Ajay,
>>>
>>>
>>> On 7 December 2014 at 22:43, Ajay kumar  wrote:

 Hi Minkyu,


 On Mon, Dec 8, 2014 at 11:07 AM, Ajay kumar  wrote:
 > On Fri, Dec 5, 2014 at 9:02 PM, Minkyu Kang  wrote:
 >> Dear Ajay Kumar,
 >>
 >> On 5 December 2014 at 23:13, Ajay Kumar 
 >> wrote:
 >>
 >>> Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by
 >>> exynos video driver.
 >>>
 >>> Signed-off-by: Ajay Kumar 
 >>> ---
 >>>  arch/arm/cpu/armv7/exynos/clock.c  |   63
 >>> +++-
 >>>  arch/arm/include/asm/arch-exynos/clk.h |3 ++
 >>>  2 files changed, 64 insertions(+), 2 deletions(-)
 >>>
 >>> diff --git a/arch/arm/cpu/armv7/exynos/clock.c
 >>> b/arch/arm/cpu/armv7/exynos/clock.c
 >>> index 8fab135..1a34ad6 100644
 >>> --- a/arch/arm/cpu/armv7/exynos/clock.c
 >>> +++ b/arch/arm/cpu/armv7/exynos/clock.c
 >>> @@ -1066,6 +1066,36 @@ static unsigned long
 >>> exynos5420_get_lcd_clk(void)
 >>> return pclk;
 >>>  }
 >>>
 >>> +static unsigned long exynos5800_get_lcd_clk(void)
 >>> +{
 >>> +   struct exynos5420_clock *clk =
 >>> +   (struct exynos5420_clock *)samsung_get_base_clock();
 >>> +   unsigned long sclk;
 >>> +   unsigned sel;
 >>>
 >>
 >> just unsigned? why don't you specify in detail?
 I will fix this.

 >>
 >>> +   unsigned ratio;
 >>> +
 >>> +   sel = (readl(&clk->src_disp10) >> 4) & 7;
 >>>
 >>
 >> please add comment how you get "sel" from disp10.
 >> and if 7 means mask then please use 0x7. it looks more clearly.
 Ok.

 >> +
 >>> +   /*
 >>> +* Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
 >>> +* PLLs. The first element is a placeholder to bypass the
 >>> +* default settig.
 >>> +*/
 >>> +   const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
 >>> +  IPLL, EPLL,  RPLL};
 >>>
 >>
 >> please don't define local variable at middle of function.
 >> you can move it to top of the function or
 >> it seems to use sel is true then you can move it into the if statement.
 I will move this to the top of the function.

 >>
 >>> +   if (sel)
 >>> +   sclk = get_pll_clk(reg_map[sel]);
 >>> +   else
 >>> +   sclk = 2400;
 >>>
 >>
 >> please define this value.
 Ok.

 >>
 >>> +   /*
 >>> +* CLK_DIV_DISP10
 >>> +* FIMD1_RATIO [3:0]
 >>> +*/
 >>> +   ratio = readl(&clk->div_disp10) & 0xf;
 >>> +
 >>> +   return sclk / (ratio + 1);
 >>> +}
 >>> +
 >>>  void exynos4_set_lcd_clk(void)
 >>>  {
 >>> struct exynos4_clock *clk =
 >>> @@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
 >>> writel(cfg, &clk->div_disp10);
 >>>  }
 >>>
 >>> +void exynos5800_set_lcd_clk(void)
 >>> +{
 >>> +   struct exynos5420_clock *clk =
 >>> +   (struct exynos5420_clock *)samsung_get_base_clock();
 >>> +   unsigned int cfg;
 >>> +
 >>> +   /*
 >>> +* Use RPLL for pixel clock
 >>> +* CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
 >>> +* ==
 >>> +* 111: SCLK_RPLL
 >>> +*/
 >>> +   cfg = readl(&clk->src_disp10) | (7 << 4);
 >>> +   writel(cfg, &clk->src_disp10);
 >>> +
 >>> +   /*
 >>> +* CLK_DIV_DISP10
 >>> +* FIMD1_RATIO  [3:0]
 >>> +*/
 >>> +   cfg = readl(&clk->div_disp10);
 >>> +   cfg &= ~(0xf << 0);
 >>> +   cfg |= (0 << 0);
 >>>
 >>
 >> it looks meaningless.
 Why not?
 I agree that the calculation can be skipped, and directly FIMD
 clock divider can be set to 0. But, I prefer to keep the readability.
 In fact, similar "meaningless" code is already part of the tree:

 http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194
>>>
>>>
>>> Well perhaps a #define for the shift value? Then it would mean something.
>>>
>>> Also this can probably use clrsetbits_le32().
>>
>> This is one of four patches that I think were never applied and need a
>> respin. Are you able to do that? Then Pi LCD will work OK I think.
> Yes, I am respinning this patch. Also, trying to move out GPIOs from
> smdk5420.c. Will be posting them tomorrow.

OK great. You might find gpio_request_by_name() useful, and
gpio_request_by_name_nodev() wher

Re: [U-Boot] [PATCH 2/5] arm: exynos: add display clocks for Exynos5800

2015-03-02 Thread Ajay kumar
Hi Simon,

On Mon, Mar 2, 2015 at 7:53 AM, Simon Glass  wrote:
> Hi Ajay,
>
> On 8 December 2014 at 15:40, Simon Glass  wrote:
>> Hi Ajay,
>>
>>
>> On 7 December 2014 at 22:43, Ajay kumar  wrote:
>>>
>>> Hi Minkyu,
>>>
>>>
>>> On Mon, Dec 8, 2014 at 11:07 AM, Ajay kumar  wrote:
>>> > On Fri, Dec 5, 2014 at 9:02 PM, Minkyu Kang  wrote:
>>> >> Dear Ajay Kumar,
>>> >>
>>> >> On 5 December 2014 at 23:13, Ajay Kumar 
>>> >> wrote:
>>> >>
>>> >>> Add get_lcd_clk and set_lcd_clk callbacks for Exynos5800 needed by
>>> >>> exynos video driver.
>>> >>>
>>> >>> Signed-off-by: Ajay Kumar 
>>> >>> ---
>>> >>>  arch/arm/cpu/armv7/exynos/clock.c  |   63
>>> >>> +++-
>>> >>>  arch/arm/include/asm/arch-exynos/clk.h |3 ++
>>> >>>  2 files changed, 64 insertions(+), 2 deletions(-)
>>> >>>
>>> >>> diff --git a/arch/arm/cpu/armv7/exynos/clock.c
>>> >>> b/arch/arm/cpu/armv7/exynos/clock.c
>>> >>> index 8fab135..1a34ad6 100644
>>> >>> --- a/arch/arm/cpu/armv7/exynos/clock.c
>>> >>> +++ b/arch/arm/cpu/armv7/exynos/clock.c
>>> >>> @@ -1066,6 +1066,36 @@ static unsigned long
>>> >>> exynos5420_get_lcd_clk(void)
>>> >>> return pclk;
>>> >>>  }
>>> >>>
>>> >>> +static unsigned long exynos5800_get_lcd_clk(void)
>>> >>> +{
>>> >>> +   struct exynos5420_clock *clk =
>>> >>> +   (struct exynos5420_clock *)samsung_get_base_clock();
>>> >>> +   unsigned long sclk;
>>> >>> +   unsigned sel;
>>> >>>
>>> >>
>>> >> just unsigned? why don't you specify in detail?
>>> I will fix this.
>>>
>>> >>
>>> >>> +   unsigned ratio;
>>> >>> +
>>> >>> +   sel = (readl(&clk->src_disp10) >> 4) & 7;
>>> >>>
>>> >>
>>> >> please add comment how you get "sel" from disp10.
>>> >> and if 7 means mask then please use 0x7. it looks more clearly.
>>> Ok.
>>>
>>> >> +
>>> >>> +   /*
>>> >>> +* Mapping of CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4] values into
>>> >>> +* PLLs. The first element is a placeholder to bypass the
>>> >>> +* default settig.
>>> >>> +*/
>>> >>> +   const int reg_map[] = {0, CPLL, DPLL, MPLL, SPLL,
>>> >>> +  IPLL, EPLL,  RPLL};
>>> >>>
>>> >>
>>> >> please don't define local variable at middle of function.
>>> >> you can move it to top of the function or
>>> >> it seems to use sel is true then you can move it into the if statement.
>>> I will move this to the top of the function.
>>>
>>> >>
>>> >>> +   if (sel)
>>> >>> +   sclk = get_pll_clk(reg_map[sel]);
>>> >>> +   else
>>> >>> +   sclk = 2400;
>>> >>>
>>> >>
>>> >> please define this value.
>>> Ok.
>>>
>>> >>
>>> >>> +   /*
>>> >>> +* CLK_DIV_DISP10
>>> >>> +* FIMD1_RATIO [3:0]
>>> >>> +*/
>>> >>> +   ratio = readl(&clk->div_disp10) & 0xf;
>>> >>> +
>>> >>> +   return sclk / (ratio + 1);
>>> >>> +}
>>> >>> +
>>> >>>  void exynos4_set_lcd_clk(void)
>>> >>>  {
>>> >>> struct exynos4_clock *clk =
>>> >>> @@ -1197,6 +1227,31 @@ void exynos5420_set_lcd_clk(void)
>>> >>> writel(cfg, &clk->div_disp10);
>>> >>>  }
>>> >>>
>>> >>> +void exynos5800_set_lcd_clk(void)
>>> >>> +{
>>> >>> +   struct exynos5420_clock *clk =
>>> >>> +   (struct exynos5420_clock *)samsung_get_base_clock();
>>> >>> +   unsigned int cfg;
>>> >>> +
>>> >>> +   /*
>>> >>> +* Use RPLL for pixel clock
>>> >>> +* CLK_SRC_DISP10 CLKMUX_FIMD1 [6:4]
>>> >>> +* ==
>>> >>> +* 111: SCLK_RPLL
>>> >>> +*/
>>> >>> +   cfg = readl(&clk->src_disp10) | (7 << 4);
>>> >>> +   writel(cfg, &clk->src_disp10);
>>> >>> +
>>> >>> +   /*
>>> >>> +* CLK_DIV_DISP10
>>> >>> +* FIMD1_RATIO  [3:0]
>>> >>> +*/
>>> >>> +   cfg = readl(&clk->div_disp10);
>>> >>> +   cfg &= ~(0xf << 0);
>>> >>> +   cfg |= (0 << 0);
>>> >>>
>>> >>
>>> >> it looks meaningless.
>>> Why not?
>>> I agree that the calculation can be skipped, and directly FIMD
>>> clock divider can be set to 0. But, I prefer to keep the readability.
>>> In fact, similar "meaningless" code is already part of the tree:
>>>
>>> http://git.denx.de/?p=u-boot/u-boot-samsung.git;a=blob;f=arch/arm/cpu/armv7/exynos/clock.c;h=8fab135bebf4ef6900677847b60a8e1a1520254c;hb=HEAD#l1194
>>
>>
>> Well perhaps a #define for the shift value? Then it would mean something.
>>
>> Also this can probably use clrsetbits_le32().
>
> This is one of four patches that I think were never applied and need a
> respin. Are you able to do that? Then Pi LCD will work OK I think.
Yes, I am respinning this patch. Also, trying to move out GPIOs from
smdk5420.c. Will be posting them tomorrow.

Ajay
> http://patchwork.ozlabs.org/patch/418116/
> http://patchwork.ozlabs.org/patch/418117/
> http://patchwork.ozlabs.org/patch/418118/
> http://patchwork.ozlabs.org/patch/418119/
>
> Regards.
> Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
http:/

Re: [U-Boot] [PATCH] warp: Add a README file

2015-03-02 Thread Eric Nelson
On 03/02/2015 08:52 AM, Fabio Estevam wrote:
> Hi Eric,
> 
> On Mon, Mar 2, 2015 at 12:48 PM, Eric Nelson
>  wrote:
> 
>> It's probably best to use ours, but we're okay either way.
>>
>> I wasn't aware that Warp had forked imx_usb_loader, but a quick
>> read shows that it's behind by a couple of (minor) updates.
>>
>> As for the mx6sl_usb_work.conf file, we'll certainly allow
>> the Warp-specific version to be stored in our repository
>> as long as it's named for the Warp
>>
>> i.e.:
>> mx6sl_usb_work-warp.conf
>>
>> If somebody want to push a pull request, we'll be happy
>> to stash it there.
> 
> I have just tested top of tree imx_usb_loader from Boundary Device and
> it can load U-boot on mx6sl without any change.
> 

Cool. Glad to hear it.

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


Re: [U-Boot] [PATCH] fixdep: remove multiple .config support code

2015-03-02 Thread Simon Glass
On 27 February 2015 at 08:37, Masahiro Yamada  wrote:
> Since commit e02ee2548afe (kconfig: switch to single .config
> configuration), the ".*.cmd" files are not correctly created
> for SPL/TPL.  The U-Boot extension code in fixdep, which was
> introduced to support the multiple .config, must be removed.
>
> Signed-off-by: Masahiro Yamada 
> ---
> Tom,
>
> Sorry, this is an urgent bug fix.
>
>  scripts/basic/fixdep.c | 6 +-
>  1 file changed, 1 insertion(+), 5 deletions(-)

Reviewed-by: Simon Glass 

>
> diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
> index 1a41723..b304068 100644
> --- a/scripts/basic/fixdep.c
> +++ b/scripts/basic/fixdep.c
> @@ -221,11 +221,7 @@ static void use_config(const char *m, int slen)
>
> define_config(m, slen, hash);
>
> -   /* printf("$(wildcard include/config/"); */
> -   /* modified for U-Boot */
> -   printf("$(wildcard %sinclude/config/",
> -  strncmp(depfile, "spl/", 4) ?
> -  (strncmp(depfile, "tpl/", 4) ? "" : "tpl/") : "spl/");
> +   printf("$(wildcard include/config/");
> for (i = 0; i < slen; i++) {
> c = m[i];
> if (c == '_')
> --
> 1.9.1
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] common/board_f: implement type casting for gd structure

2015-03-02 Thread Simon Glass
On 25 February 2015 at 07:59, Alexey Brodkin
 wrote:
> In case of global data structure defined as "register volatile" compiler
> throws an warning about incorrect type used:
>  --->8---
>  common/board_f.c: In function "board_init_f_r":
>  common/board_f.c:1073:2: warning: passing argument 1 of "&board_init_r
>  +(sizetype)gd->reloc_off" discards "volatile" qualifier from pointer
>  target type [enabled by default]
>   (board_init_r + gd->reloc_off)(gd, gd->relocaddr);
>   ^
>  common/board_f.c:1073:2: note: expected "struct gd_t *" but argument is
>  of type "volatile struct gd_t *"
>  --->8---
>
> An obvious fix is manual casting to "gd_t *".
>
> Signed-off-by: Alexey Brodkin 
> Cc: Simon Glass 
> Cc: Tom Rini 
> ---
>  common/board_f.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

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


Re: [U-Boot] board_f for x86

2015-03-02 Thread Simon Glass
Hi Alexey,

On 25 February 2015 at 04:06, Alexey Brodkin
 wrote:
> Hi Simon,
>
> I'm currently reworking start-up code for ARC with intention to leave as
> little of assembly code as possible. On that way I decided to use the
> same approach as x86 does.
>
> In particular I mean:
>
>  * Use of sequence "copy_uboot_to_ram", "clear_bss" &
> "do_elf_reloc_fixups".
>
>  * Use of "board_init_f_r_trampoline" for final fix-ups after relocation
> (basically I do new stack-pointers setup and that's it)
>
>  * Use of "board_init_f_r" with "init_sequence_f_r"
>
> I may post patches that implement those changes for ARC if of any
> interest.

Sounds good. I think ARM could move the same way.

>
> During this development I faced a number of questions I'd like to
> discuss.
>
>  [1] Comment to "init_sequence_f_r" says:
>  --->8---
>  The '_f_r' sequence must, as a minimum, copy U-Boot to RAM (if
>  supported).  It _should_, if possible, copy global data to RAM and
>  initialise the CPU caches (to speed up the relocation process)
>  --->8---
>
> And indeed we have "init_cache_f_r" in that sequence, but what looks
> strange to me - isn't it too late for caches to be enabled (in terms of
> relocation speed-up)? Because relocation (both copying and fixups)
> happens in the end of "init_sequence_f" before jump_to_copy() where for
> x86 we call board_init_f_r_trampoline() -> board_init_f_r().

Yes that's right. This change was made quite recently, because on x86
we run from 'cache-as-ram' which means that when we switch over the
cache to be a normal cache, we lose our old RAM.

In jump_to_copy() on x86, the call to board_init_f_r_trampoline()
changes things over. The old temporary RAM (including global_data goes
away). The new stack and global data is in SDRAM. Then it calls
board_init_f_r().

The change to the code happened during the bare x86 support. It does
need another look as it is not optimal, although the cache is
generally on at least in bare mode.

>
> So probably we need to move cache_enable() before copy_uboot_to_ram in
> "init_sequence_f"?

Yes, but copy_uboot_to_ram() uses global_data so we can't do that on
x86. I think we should do something like change to the new SRAM-based
global_data earlier to avoid this problem.

>
>  [2] Why "board_init_f_mem" is placed in #else /* CONFIG_X86 */? I would
> say that this function is orthogonal to a particular architecture.

Yes I'd like this function to be generic, called from all archs.

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


Re: [U-Boot] [PATCH] lib/asm-offsets - make GD_RELOCADDR, GD_RELOC_OFF & GD_START_ADDR_SP available for all architectures

2015-03-02 Thread Simon Glass
On 25 February 2015 at 03:09, Alexey Brodkin
 wrote:
> GD_RELOCADDR, GD_RELOC_OFF & GD_START_ADDR_SP are generic members of
> global data structure so why don't we allow architectures other than ARM
> to use it.
>
> Signed-off-by: Alexey Brodkin 
> Cc: Simon Glass 
> Cc: Tom Rini 
> ---
>  lib/asm-offsets.c | 4 
>  1 file changed, 4 deletions(-)

Acked-by: Simon Glass 

>
> diff --git a/lib/asm-offsets.c b/lib/asm-offsets.c
> index 129bc3e..221ebbf 100644
> --- a/lib/asm-offsets.c
> +++ b/lib/asm-offsets.c
> @@ -32,15 +32,11 @@ int main(void)
> DEFINE(GD_MALLOC_BASE, offsetof(struct global_data, malloc_base));
>  #endif
>
> -#if defined(CONFIG_ARM)
> -
> DEFINE(GD_RELOCADDR, offsetof(struct global_data, relocaddr));
>
> DEFINE(GD_RELOC_OFF, offsetof(struct global_data, reloc_off));
>
> DEFINE(GD_START_ADDR_SP, offsetof(struct global_data, start_addr_sp));
>
> -#endif
> -
> return 0;
>  }
> --
> 2.1.0
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] warp: Add a README file

2015-03-02 Thread Fabio Estevam
Provide instructions on how to upgrade U-boot in the eMMC.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Use Boundary Device's tree for imx_usb_loader
- Pass u-boot.imx as an argument of imx_usb

 board/warp/README | 56 +++
 1 file changed, 56 insertions(+)
 create mode 100644 board/warp/README

diff --git a/board/warp/README b/board/warp/README
new file mode 100644
index 000..d315140
--- /dev/null
+++ b/board/warp/README
@@ -0,0 +1,56 @@
+How to Update U-boot on Warp board
+--
+
+Required software on the host PC:
+
+- imx_usb_loader: https://github.com/boundarydevices/imx_usb_loader
+
+- dfu-util: http://dfu-util.sourceforge.net/releases/
+
+Build U-boot for Warp:
+
+$ make mrproper
+$ make warp_config
+$ make
+
+This will generate the U-boot binary called u-boot.imx.
+
+Put warp board in USB download mode
+
+Connect a USB to serial adapter between the host PC and warp
+
+Connect a USB cable between the OTG warp port and the host PC
+
+Open a terminal program such as minicom
+
+Copy u-boot.imx to the imx_usb_loader folder.
+
+Load u-boot.imx via USB:
+
+$ sudo ./imx_usb u-boot.imx
+
+Then U-boot should start and its messages will appear in the console program.
+
+Use the default environment variables:
+
+=> env default -f -a
+=> save
+
+Run the DFU command:
+=> dfu 0 mmc 0
+
+Transfer u-boot.imx that will be flashed into the eMMC:
+
+$ sudo dfu-util -D u-boot.imx -a boot
+
+Then on the U-boot prompt the following message should be seen after a 
succesful
+upgrade:
+
+#DOWNLOAD ... OK
+Ctrl+C to exit ...
+
+Remove power from the warp board.
+
+Put warp board into normal boot mode
+
+Power up the board and the new updated U-boot should boot from eMMC
-- 
1.9.1

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


Re: [U-Boot] [PATCH] warp: Add a README file

2015-03-02 Thread Eric Nelson
Hi Fabio,

On 03/02/2015 08:33 AM, Fabio Estevam wrote:
> Hi Otavio,
> 
> On Mon, Mar 2, 2015 at 11:52 AM, Otavio Salvador
>  wrote:
> 
>>> +Required software on the host PC:
>>> +
>>> +- imx_loader: https://github.com/warpboard/imx_usb_loader
>>
>> I see no reason to link WaRP's fork. The Boundary Devices upstream
>> code offers a more up to date bases and I think we should give them
>> the credit for the tool. Mind to change it?
> 
> No problem for me to link Boundary Device's tree, but then we would
> need to create a mx6sl_usb_work.conf in this tree, so that the
> LOADADDR could be adapted for mx6sl. Then we also need to pass
> mx6sl_usb_work.conf
> in the imx_usb command line.
> 
> Eric,
> 
> What do you think?
> 
It's probably best to use ours, but we're okay either way.

I wasn't aware that Warp had forked imx_usb_loader, but a quick
read shows that it's behind by a couple of (minor) updates.

As for the mx6sl_usb_work.conf file, we'll certainly allow
the Warp-specific version to be stored in our repository
as long as it's named for the Warp

i.e.:
mx6sl_usb_work-warp.conf

If somebody want to push a pull request, we'll be happy
to stash it there.

Regards,


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


Re: [U-Boot] [PATCH] warp: Add a README file

2015-03-02 Thread Fabio Estevam
Hi Eric,

On Mon, Mar 2, 2015 at 12:48 PM, Eric Nelson
 wrote:

> It's probably best to use ours, but we're okay either way.
>
> I wasn't aware that Warp had forked imx_usb_loader, but a quick
> read shows that it's behind by a couple of (minor) updates.
>
> As for the mx6sl_usb_work.conf file, we'll certainly allow
> the Warp-specific version to be stored in our repository
> as long as it's named for the Warp
>
> i.e.:
> mx6sl_usb_work-warp.conf
>
> If somebody want to push a pull request, we'll be happy
> to stash it there.

I have just tested top of tree imx_usb_loader from Boundary Device and
it can load U-boot on mx6sl without any change.

Thanks,

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


Re: [U-Boot] [RFC PATCH v4 21/23] sandbox: eth: Add a bridge to a real network for sandbox

2015-03-02 Thread Simon Glass
Hi Joe,

On 2 March 2015 at 00:17, Joe Hershberger  wrote:
> On Sun, Mar 1, 2015 at 12:07 PM, Simon Glass  wrote:
>>
>> On 24 February 2015 at 17:02, Joe Hershberger 
>> wrote:
>> > Implement a bridge between u-boot's network stack and Linux's raw packet
>> > API allowing the sandbox to send and receive packets using the host
>> > machine's network interface.
>> >
>> > This raw Ethernet API requires elevated privileges.  You can either run
>> > as root, or you can add the capability needed like so:
>> >
>> > sudo /sbin/setcap "CAP_NET_RAW+ep" u-boot
>> >
>> > Signed-off-by: Joe Hershberger 
>>
>> Reviewed-by: Simon Glass 
>>
>> A few nits below.

[snip]

>> >
>> > +Linux RAW Networking Bridge
>> > +---
>> > +
>> > +The sandbox_eth_raw driver bridges traffic between the bottom of the
>> > network
>> > +stack and the RAW sockets API in Linux. This allows much of the u-boot
>> > network
>> > +functionality to be tested in sandbox against real network traffic.
>> > +
>> > +The RAW sockets Ethernet API requires elevated privileges in Linux. You
>> > can
>> > +either run as root, or you can add the capability needed like so:
>> > +
>> > +sudo /sbin/setcap "CAP_NET_RAW+ep" u-boot
>>
>> This is so cool.
>
> :D
>
>> Can you give some examples here? For me, ping seems to work, but I
>> can't use bootp. Is that what the raw mode is for? How do I enable it?
>> I tried setting ethact but am not sure what I am doing.
>
> Sorry it's not clear. I'll update it, but if you want to play with it in the
> mean time, I'll explain here. But first, what were the symptoms where you
> say you couldn't use bootp?
>
> This patch only supports the RAW AF_PACKET API.  This is needed to get
> access to the lowest level of the network stack in Linux. This means that
> all of the Ethernet frame is included. This allows the u-boot network stack
> to be fully used. In other words, nothing about the Linux network stack is
> involved in forming the packets that end up on the wire. To receive the
> responses to packets sent from u-boot the network interface has to be set to
> promiscuous mode so that the network card won't filter out packets not
> destined for its configured (on Linux) MAC address.
>
> The device tree as added by this patch should be everything you need to use
> eth0 on the host machine.
>
> To contrast, the patch that adds support for the 'lo' interface cannot use
> the RAW AF_PACKET API because the lo interface doesn't support
> Ethernet-level traffic. It is a higher-level interface that is expected only
> to be used at the AF_INET level of the API. As such, the most raw we can get
> on that interface is the RAW AF_INET API on UDP. This allows us to set the
> IP_HDRINCL option to include everything except the Ethernet header in the
> packets we send and receive.
>
> There is no decision to make. The local code path will only work on the 'lo'
> interface and the not-local code path will only work on non-'lo' interface.
> This check is explicit in sb_eth_raw_start().
>
>> Useful examples would be:
>>
>> - ping
>> - bootp
>> - tftpboot
>
> I have tested all 3 of these with just the device tree included in this
> patch. All that you need to do is set the eth1addr to something. Set ethact
> to "eth1".
>
> You can then use dhcp (typically need to set autoload to no first) or set a
> static IP. Then you can ping or tftp.
>
> If you set ethact to eth5 (the localhost interface in the device tree in the
> 'lo' support patch) then don't expect ping to work, but you should be able
> to tftpboot from the local TFTP server.
>
>> and how to use raw/normal device.
>
> I hope this is clear above.
>

OK the ethact might have been what I was missing. Anyway I'll wait
until you update the README and try again.

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


Re: [U-Boot] [PATCH v1 1/1] fastboot: Add support for flashing zImage

2015-03-02 Thread Tom Rini
On Wed, Feb 25, 2015 at 06:30:30PM -0600, Rob Herring wrote:
> On Wed, Feb 25, 2015 at 4:56 PM, Dileep Katta  wrote:
> > This patch adds support to flash zImage to the boot partition on eMMC.
> > Usage: fastboot flash zImage 
> 
> So this replaces the kernel in an existing bootimage. What's wrong
> with "fastboot flash boot", "fastboot flash:raw boot " or
> "fastboot boot "? It is a bit fragile to be updating your
> kernel without updating the ramdisk. arm64 has no zImage, so this
> command is somewhat arm32 specific.
> 
> Fastboot is already plagued with a variety of implementations and
> behaviors. Some unification here would be good and just adding
> whatever various commands have been added to vendor u-boot's is not
> going to help. Adding to the combinations of things to test also
> bothers me.

+1.  Just how much room do we have, or not have, to be compatible with
existing tools but also abstract some of this out so that different
boards can "I want a layout like this ..." (one set of kernel, device
tree, initrd) and another "I want a layout like this ..." (two sets, for
redundancy).

-- 
Tom


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


  1   2   >