Re: [U-Boot] Rockchip patches for testing

2016-09-23 Thread Sandy Patterson
On Thu, Sep 22, 2016 at 11:17 PM, Simon Glass  wrote:

> Hi,
>
> I have pushed a branch to u-boot-rockchip/testing. Please take a look
> and let me know if any of these patches need rework.
>
> Are there more patches coming for this merge window?
>
> Re rk3399, one of the patches causes a build error on rk3399. Can
> someone please take a look?
>
> buildman -b rk-push rockchip -se
> boards.cfg is up to date. Nothing to do.
> Summary of 14 commits for 10 boards (8 threads, 1 job per thread)
> 01: Merge git://git.denx.de/u-boot-rockchip
> 02: rockchip: rk3288: sdram: fix DDR address range
> 03: rockchip: Fix SPL console output when ROCKCHIP_SPL_BACK_TO_BROM is
> enabled
> 04: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.
> 05: Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board
> 06: rockchip: add usb mass storage feature support for rk3036
> 07: rockchip: rk3399: update PPLL and pmu_pclk frequency
> 08: rockchip: rkpwm: fix the register sequence
> 09: power: regulator: add pwm regulator
> 10: rockchip: evb_rk3399: init vdd_center regulator
> 11: Kconfig: rockchip: enable DM_PWM and DM_REGULATOR
> 12: dts: evb-rk3399: add init voltage node for vdd-center
> 13: config: evb-rk3399: enable pwm regulator
>aarch64:  +   evb-rk3399
> +../drivers/power/regulator/pwm_regulator.c: In function
> 'pwm_regulator_probe':
> +../drivers/power/regulator/pwm_regulator.c:135:10: error: 'struct
> pwm_regulator_info' has no member named 'boot_on'
> +  if (priv->boot_on)
> +  ^
> +make[2]: *** [drivers/power/regulator/pwm_regulator.o] Error 1
> +make[1]: *** [drivers/power/regulator] Error 2
> +make: *** [sub-make] Error 2
>
> Regards,
> Simon
>

Tested on rock2-rk3288 2GB RAM:
Tested-by: Sandy Patterson 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] disabling mmc in spl when booting using bootrom

2016-09-23 Thread Sandy Patterson
>
> My concern with the Rockchip back-to-brom feature is that then U-Boot
> cannot load U-Boot normally as SPL likes to do. I think it is fine
> when we are short on space, but OF_PLATDATA fixes that.
>
> So I think the back-to-rom feature need to be optional on boards which
> don't have to use it, since it uses a non-standard boot approach,
>
>
It seems like OF_PLATDATA could be used across the board for RK3288. We
found that the amount of code changes in the two approaches made us more
comfortable using the RK3288 BOOTROM to load u-boot proper. But that was
for our specific use case.

Thanks for the feedback. I'll abandon this changeset. Kever is essentially
doing what you recommend in his SDRAM patches anyway.

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


Re: [U-Boot] [PATCH v2 0/3] Add sdram capacity auto detect for rk3288

2016-09-21 Thread Sandy Patterson
On Tue, Sep 20, 2016 at 10:56 PM, Kever Yang 
wrote:
>
> parameters changes from dts to auto-detect including those I removed from
> dts and ddrconfig, stride, they should be the same as without my patch,
> which means my patch suppose to not change any parameter for DDR other than
> how we get those parameters.
>

EARLY_DEBUG was the right idea. Only for some reason it's called EARLY_UART
on rk3288.

I tested rock2 and it is getting dbw parameter of 2 instead of 1 for with
the unmodified code for both channels. I'm afraid I do not know the
significance of this and don't have a good way to test for stability. I am
using rock2 square model a with 2gb ram.

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


Re: [U-Boot] [PATCH v2 1/3] rk3288: config change for enable dram capacity auto-detect.

2016-09-21 Thread Sandy Patterson
On Tue, Sep 20, 2016 at 11:00 PM, Kever Yang 
wrote:

> Hi Sandy,
>
> On 09/20/2016 09:21 PM, Sandy Patterson wrote:
>
> You're probably going to need to change this around now that the Kconfig
> stuff has been applied to master. Suggest following patch instead:
>
>
> I didn't enable the BACK_TO_BROM for all of rk3288 board, because boards
> like firefly and chromebook-jerry have enough space without this macro,
> and I'm not able to test them, so I only change for those boards which
> must enable this macro.
>
That's fine, I only meant to suggest you use Kconfig instead. If you want
to only change a few boards you can do this with *_defconfig file now. This
way those options are controllable from "make menuconfig" after make
*_defconfig.

>
> What's you opinion for firefly-rk3288 and chrome-jerry?
>
I had a firefly, I expect this should work fine with BACK_TO_BROM option,
but I have broken it, so I can't test. Vagrant probably can though. I don't
know anything about chrome-jerry, but it has a lot of different storage
settings.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 0/3] Add sdram capacity auto detect for rk3288

2016-09-20 Thread Sandy Patterson
I can confirm that this boots on rock2 with current master branch.
9b1b6d42256a4c2e59c803afdbf90d39371e61ba

It doesn't boot for me using rock2 on v2016.09 tag. I get:
U-Boot SPL 2016.09-2-g690a8a3 (Sep 20 2016 - 10:47:44)
Trying to boot from MMC1

It continues to detect 2GB of ram. on master.

I get nervous with these memory changes. We found that some memory
parameters persisted through to linux and had the ability to cause
instability. I don't run have linux setup right now on my rock2, so I can't
test that.

I also wanted to test that the parameters detected via the new routine
matched those removed from the dts file. I tried enabling DEBUG but that
somehow caused no console output anymore (on master). I'm not sure what's
going on. I also tried doing some printfs but they had the same effect. It
looks like somehow the console init has moved and maybe isn't setup yet.

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


Re: [U-Boot] [PATCH v2 1/3] rk3288: config change for enable dram capacity auto-detect.

2016-09-20 Thread Sandy Patterson
You're probably going to need to change this around now that the Kconfig
stuff has been applied to master. Suggest following patch instead:

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 1aac3c8..dc471d6 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -36,7 +36,7 @@ config ROCKCHIP_RK3399

 config ROCKCHIP_SPL_BACK_TO_BROM
bool "SPL returns to bootrom"
-   default y if ROCKCHIP_RK3036
+   default y if ROCKCHIP_RK3036 || ROCKCHIP_RK3288
help
  Rockchip SoCs have ability to load SPL & U-Boot binary. If
enabled,
   SPL will return to the boot rom, which will then load the U-Boot
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig
b/arch/arm/mach-rockchip/rk3288/Kconfig
index 94863a9..1425ce1 100644
--- a/arch/arm/mach-rockchip/rk3288/Kconfig
+++ b/arch/arm/mach-rockchip/rk3288/Kconfig
@@ -82,7 +82,7 @@ config SPL_LIBGENERIC_SUPPORT
default y

 config SPL_MMC_SUPPORT
-   default y
+   default y if !ROCKCHIP_SPL_BACK_TO_BROM

 config SPL_SERIAL_SUPPORT
default y


On Mon, Sep 19, 2016 at 11:28 PM, Kever Yang 
wrote:

> Enable ROCKCHIP_SPL_BACK_TO_BROM and disable CONFIG_SPL_MMC_SUPPORT
> to save memory in order to enable add source code for dram capacity
> auto-detect.
>
> Signed-off-by: Kever Yang 
> ---
>
> Changes in v2: None
>
>  include/configs/evb_rk3288.h  | 3 +--
>  include/configs/fennec_rk3288.h   | 3 +--
>  include/configs/miniarm_rk3288.h  | 3 +--
>  include/configs/popmetal_rk3288.h | 3 +--
>  4 files changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
> index 342557f..9f32184 100644
> --- a/include/configs/evb_rk3288.h
> +++ b/include/configs/evb_rk3288.h
> @@ -7,11 +7,10 @@
>  #ifndef __CONFIG_H
>  #define __CONFIG_H
>
> +#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_
> rk3288.h
> index 342557f..9f32184 100644
> --- a/include/configs/fennec_rk3288.h
> +++ b/include/configs/fennec_rk3288.h
> @@ -7,11 +7,10 @@
>  #ifndef __CONFIG_H
>  #define __CONFIG_H
>
> +#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_
> rk3288.h
> index 342557f..9f32184 100644
> --- a/include/configs/miniarm_rk3288.h
> +++ b/include/configs/miniarm_rk3288.h
> @@ -7,11 +7,10 @@
>  #ifndef __CONFIG_H
>  #define __CONFIG_H
>
> +#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/popmetal_rk3288.h b/include/configs/popmetal_
> rk3288.h
> index 342557f..9f32184 100644
> --- a/include/configs/popmetal_rk3288.h
> +++ b/include/configs/popmetal_rk3288.h
> @@ -7,11 +7,10 @@
>  #ifndef __CONFIG_H
>  #define __CONFIG_H
>
> +#define CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> --
> 1.9.1
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] Add sdram capacity auto detect for rk3288

2016-09-20 Thread Sandy Patterson
>
> 1) It seems the BACK_TO_BROM feature is broken. It doesn't boot using the
>> 2016.09. I'm afraid I don't have the time to track it down.
>>
> It works fine on my evb, do you flash the image correctly? it's different
> with the way you don't use BACK_TO_BROM.
>

Well, I tested again on the latest master branch and its working now. I
probably had something screwed up. I did notice that the BACK_TO_BROM was
moved to Kconfig.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] Add sdram capacity auto detect for rk3288

2016-09-19 Thread Sandy Patterson
Hi Kever and Vagrant,

I tested this patch on my rock2 board against 2016.09. (I didn't have my
board with me over the weekend)

1) It seems the BACK_TO_BROM feature is broken. It doesn't boot using the
2016.09. I'm afraid I don't have the time to track it down.
2) It seems the SPL is still small enough to test this feature. (vagrant
you can forget about the back to brom feature unless you need more SPL
space).

3) I get the same behavior as Vagrant on the rock2 board. I'm including
DEBUG output in case that helps Kever. I tried to trace it, but it seems a
larger undertaking than I can manage right now. (vagrant, you can add DEBUG
#define's into the file include/configs/firefly-rk3288.h to get the output
below.. my guess is it's similar.)

This trace is almost exactly the same between enabling the SDRAM detection
and not. I marked the point where it halts. The fdt is a slightly different
size, but that is expected.

Sandy


initcall: 0010af55
U-Boot code: 0010 -> 0014F8C0  BSS: -> 0018D1B8
initcall: 0010add1
initcall: 0010b359
Model: Radxa Rock 2 Square
initcall: 0010af95
DRAM:  initcall: 00100d19
malloc_simple: size=3c, ptr=7d8, limit=2000: fe79c
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
malloc_simple: size=4, ptr=7dc, limit=2000: fe7d8
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 1
   - -1 -1
   - -1 0
   - found
uclass_find_device_by_seq: 0 1
   - -1 1
   - found
uclass_find_device_by_seq: 0 2
   - -1 1
   - -1 -1
   - -1 0
   - -1 -1
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
malloc_simple: size=14, ptr=7f0, limit=2000: fe7dc
malloc_simple: size=4, ptr=7f4, limit=2000: fe7f0
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 1
   - -1 -1
   - -1 0
   - found
uclass_find_device_by_seq: 0 1
   - -1 1
   - found
uclass_find_device_by_seq: 0 2
   - -1 1
   - -1 -1
   - -1 0
   - -1 2
   - found
uclass_find_device_by_seq: 0 3
   - -1 1
   - -1 -1
   - -1 0
   - -1 2
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
malloc_simple: size=14, ptr=808, limit=2000: fe7f4
malloc_simple: size=c, ptr=814, limit=2000: fe808
uclass_find_device_by_seq: 0 -1
uclass_find_device_by_seq: 0 0
   - -1 -1
   - not found
fdtdec_get_int_array: interrupts
get_prop_check_min_len: interrupts
OF: ** translation for device clock-controller@ff76 **
OF: bus is default (na=1, ns=1) on
OF: translating address: 76ff
OF: reached root node
clk_request(dev=000fe474, clk=000fe7bc)
SDRAM base=0, size=8000
initcall: 0010b129
Monitor len: 0008D1B8
Ram size: 8000
Ram top: 8000
initcall: 0010adf1
initcall: 0010af0d
TLB table from 7fff to 7fff4000
initcall: 0010af75
video_reserve: Reserving 4f bytes at 7fb0 for video device
'vop@ff94'
Video frame buffers from 7fb0 to 7fff
initcall: 0010ae05
initcall: 0010aecd
Reserving 564k for U-Boot at: 7fa72000
initcall: 0010aea5
Reserving 32776k for malloc() at: 7da7
initcall: 0010b059
Reserving 80 Bytes for Board Info at: 7da6ffb0
initcall: 0010ae09
initcall: 0010ae7d
Reserving 200 Bytes for Global Data at: 7da6fee8
initcall: 0010ae2d
Reserving 38464 Bytes for FDT at: 7da668a8
initcall: 0010ae11
initcall: 0010b18d
initcall: 0010b113
initcall: 0010b099

RAM Configuration:
== SDRAM DETECTION FEATURE HALTS HERE 
Bank #0: 0 2 GiB

DRAM:  2 GiB
initcall: 0010ae19
New Stack Pointer is: 7da66880
initcall: 0010b02d
initcall: 0010afd5
Relocation Offset is: 7f972000
Relocating to 7fa72000, new gd at 7da6fee8, sp at 7da66880
initcall: 7fa7d1cd
initcall: 7fa7d1d1
initcall: 0010b32d (relocated to 7fa7d32d)
dram_bank_mmu_setup: bank: 0
initcall: 0010b305 (relocated to 7fa7d305)
efi_runtime_relocate: Relocating to offset=7fa72000
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] Add sdram capacity auto detect for rk3288

2016-09-15 Thread Sandy Patterson
Hi Kever,

With regards to the SPL size issue, I believe that the
CONFIG_ROCKCHIP_SPL_BACK_TO_BROM option should work with
all of the rk3288 boards. So if your patch causes unbootable SPL's because
they're too big, then you should probably enable the BROM macro (and
disable OF_PLATDATA).

Firefly uses a different method to shrink the SPL which causes a bunch of
changes
throughout the codebase. This patch would need to be applied to the
OF_PLATDATA
sections for firefly to work.

Vagrant,

An alternative for you might be to disable OF_PLATDATA for firefly and
enable BACK_TO_BROM.
You may not be getting any output because you didn't modify your burning
process.
See the README.rockchip section on CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
for details, but you have to dd your images slightly differently with this
macro enabled.

Also, you might get more info from Ziyuan's DEBUG advice.

Sandy Patterson


On Sun, Sep 11, 2016 at 10:01 PM, Ziyuan Xu  wrote:

> hi Vagrant,
>
>
>
> On 2016年09月11日 03:01, Vagrant Cascadian wrote:
>
>> On 2016-09-10, Ziyuan Xu wrote:
>>
>>> On 2016年09月09日 03:28, Vagrant Cascadian wrote:
>>>
>>>> On 2016-09-08, Kever Yang wrote:
>>>>
>>>>> The rk3288 spl size is very close to 32KB while the rk3288 bootrom
>>>>> has the limitation of maximum size of SPL is 32KB. After apply this
>>>>> patch, the SPL size will exceed 32KB if we do not enable macro
>>>>> CONFIG_ROCKCHIP_SPL_BACK_TO_BROM.
>>>>>
>>>> With CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y, it fails to boot with no
>> output
>> on the console.
>>
>>
>> This patch has test with 2GB DDR3 and 2GB/4GB LPDDR3.
>>>>>
>>>> Thanks for the patch!
>>>>
>>>> Unfortunately, fails to build the firefly-rk3288 target, using
>>>> arm-linux-gnueabihf-gcc (Debian 6.1.1-9) 6.1.1 20160705, applied to
>>>> u-boot master 01c5075506afcb7a74e0db8600af8979f45881b5:
>>>>
>>>> CC  spl/arch/arm/mach-rockchip/rk3288/sdram_rk3288.o
>>>> arch/arm/mach-rockchip/rk3288/sdram_rk3288.c: In function
>>>> 'conv_of_platdata':
>>>> arch/arm/mach-rockchip/rk3288/sdram_rk3288.c:1042:30: error: 'struct
>>>> dtd_rockchip_rk3288_dmc' has no member named
>>>> 'rockchip_num_channels';
>>>> did you mean 'rockchip_noc'?
>>>> plat->num_channels = of_plat->rockchip_num_channels;
>>>>
>>> -   plat->num_channels = of_plat->rockchip_num_channels;
>>> +   plat->num_channels = 2;
>>>
>>> firefly-rk3288 deploy CONFIG_OF_PLATDATA,  driver read platform data
>>> from include/generated/dt-structs.h which is generated according to dts
>>> file.
>>> Please try above change.
>>>
>> With this change, it builds, but it hangs at boot:
>>
>>U-Boot SPL 2016.09-rc2+dfsg1-2~20160910~6 (Sep 10 2016 - 18:51:28)
>>Trying to boot from MMC1
>>
>>
>>U-Boot 2016.09-rc2+dfsg1-2~20160910~6 (Sep 10 2016 - 18:51:28 +)
>>
>>Model: Firefly-RK3288
>>DRAM:
>>
>
> Could you help to add DEBUG macro in common.h like:
> #indef CONFIG_SPL_BUILD
> #define DEBUG
> #endif
>
> So that we can figure out where it is.
>
>
>
>> This is on a firefly with 2GB of ram. I also have one with 4GB of ram,
>> hence my interest in this patch series!
>>
>>
>> live well,
>>vagrant
>>
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 2/2] Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

2016-08-29 Thread Sandy Patterson
Rock2 has been tested with back to brom feature. The tricky part is that
with this feature the default environment is inside u-boot, and it's
defined for every rk3288 board independetly. So I just changed it for
rock2 here if ROCKCHIP_SPL_BACK_TO_BROM.

Solve by moving environment after u-boot before 1M boundary

Signed-off-by: Sandy Patterson 
---

Changes in v3:
 - Move activate in rock2_defconfig to proper commit.
 - Make environment changes dependent on ROCKCHIP_SPL_BACK_TO_BROM.

Changes in v2: None

 configs/rock2_defconfig | 2 +-
 include/configs/rock2.h | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index b1294f0..e34d8b3 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -10,7 +10,7 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
 CONFIG_SPL_PINCTRL_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
diff --git a/include/configs/rock2.h b/include/configs/rock2.h
index ee924c3..99d6915 100644
--- a/include/configs/rock2.h
+++ b/include/configs/rock2.h
@@ -16,11 +16,20 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
+
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
+ */
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
+#else
 /* SPL @ 32k for ~36k
  * ENV @ 96k
  * u-boot @ 128K
  */
 #define CONFIG_ENV_OFFSET (96 * 1024)
+#endif
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
-- 
1.9.1

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


[U-Boot] [PATCH v3 1/2] Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

2016-08-29 Thread Sandy Patterson
Default SPL_MMC_SUPPORT to false when ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Acked-by: Ziyuan Xu 
Signed-off-by: Sandy Patterson 
---

Changes in v3:
 - Move activate in rock2_defconfig to proper commit.

Changes in v2:
 - Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
 - Remove all the refactoring in the configs.
 - Split enabling featuring in rock2 into separate commit.

 arch/arm/mach-rockchip/Kconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 1aac3c8..8a5d62a 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -42,6 +42,9 @@ config ROCKCHIP_SPL_BACK_TO_BROM
   SPL will return to the boot rom, which will then load the U-Boot
   binary to keep going on.
 
+config SPL_MMC_SUPPORT
+   default y if !ROCKCHIP_SPL_BACK_TO_BROM
+
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3288/Kconfig"
 source "arch/arm/mach-rockchip/rk3399/Kconfig"
-- 
1.9.1

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


[U-Boot] [PATCH v3 0/2] With this change the SPL binary shrinks from 32k to 23k when

2016-08-29 Thread Sandy Patterson
ROCKCHIP_SPL_BACK_TO_BROM is enabled. This has been tested on the rock2
board. It should work with any rk3288 though since the bootrom is
loading the SPL already it should load the main U-Boot as well.

Rock2 has been tested with ROCKCHIP_SPL_BACK_TO_BROM.

Also, this moves around the images on the disk, so I had to move the
environment so it doesn't overwrite u-boot. The new env location works
with both boot methods.

Changes in v3:
 - Move activate in rock2_defconfig to proper commit.
 - Make environment changes dependent on ROCKCHIP_SPL_BACK_TO_BROM.

Changes in v2:
 - Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
 - Remove all the refactoring in the configs.
 - Split enabling featuring in rock2 into separate commit.

Sandy Patterson (2):
  Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.
  Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

 arch/arm/mach-rockchip/Kconfig | 3 +++
 configs/rock2_defconfig| 2 +-
 include/configs/rock2.h| 9 +
 3 files changed, 13 insertions(+), 1 deletion(-)

-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 2/2] Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

2016-08-28 Thread Sandy Patterson
On Sun, Aug 28, 2016 at 10:01 PM, Ziyuan Xu  wrote:

> Hi,
>
>
> On 2016年08月28日 03:39, Sandy Patterson wrote:
>
>> Rock2 has been tested with back to brom feature. The tricky part is that
>> with this feature the default environment is inside u-boot, and it's
>> defined for every rk3288 board independetly. So I just changed it for
>> rock2 here.
>>
>> Solve by moving environment after u-boot before 1M boundary
>>
>> Signed-off-by: Sandy Patterson 
>> ---
>>
>
> According to your change, I think your commit message is not match.
> Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board???


Oops. It looks like my change to the rock2_defconfig ended up in the other
patch. I'll resubmit with the defconfig in this patch.

>
>
>
>> Changes in v2: None
>>
>>   include/configs/rock2.h | 8 
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/include/configs/rock2.h b/include/configs/rock2.h
>> index ee924c3..946367f 100644
>> --- a/include/configs/rock2.h
>> +++ b/include/configs/rock2.h
>> @@ -16,11 +16,11 @@
>> #define CONFIG_ENV_IS_IN_MMC
>>   #define CONFIG_SYS_MMC_ENV_DEV 0
>> -/* SPL @ 32k for ~36k
>> - * ENV @ 96k
>> - * u-boot @ 128K
>> +/* SPL @ 32k for 34k
>> + * u-boot directly after @ 68k for 400k or so
>> + * ENV @ 992k
>>*/
>> -#define CONFIG_ENV_OFFSET (96 * 1024)
>> +#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
>> #define CONFIG_SYS_WHITE_ON_BLACK
>>   #define CONFIG_CONSOLE_SCROLL_LINES   10
>>
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/2] Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

2016-08-27 Thread Sandy Patterson
Default SPL_MMC_SUPPORT to false when ROCKCHIP_SPL_BACK_TO_BROM is enabled.

Signed-off-by: Sandy Patterson 
---

Changes in v2:
 - Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
 - Remove all the refactoring in the configs.
 - Split enabling featuring in rock2 into separate commit.

 arch/arm/mach-rockchip/Kconfig | 3 +++
 configs/rock2_defconfig| 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 1aac3c8..8a5d62a 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -42,6 +42,9 @@ config ROCKCHIP_SPL_BACK_TO_BROM
   SPL will return to the boot rom, which will then load the U-Boot
   binary to keep going on.
 
+config SPL_MMC_SUPPORT
+   default y if !ROCKCHIP_SPL_BACK_TO_BROM
+
 source "arch/arm/mach-rockchip/rk3036/Kconfig"
 source "arch/arm/mach-rockchip/rk3288/Kconfig"
 source "arch/arm/mach-rockchip/rk3399/Kconfig"
diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index b1294f0..e34d8b3 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -10,7 +10,7 @@ CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x2000
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
-CONFIG_SPL_MMC_SUPPORT=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
 CONFIG_SPL_PINCTRL_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_HUSH_PARSER=y
-- 
1.9.1

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


[U-Boot] [PATCH v2 0/2] With this change the SPL binary shrinks from 32k to 23k when

2016-08-27 Thread Sandy Patterson
ROCKCHIP_SPL_BACK_TO_BROM is enabled. This has been tested on the rock2
board. It should work with any rk3288 though since the bootrom is
loading the SPL already it should load the main U-Boot as well.

Rock2 has been tested with ROCKCHIP_SPL_BACK_TO_BROM.

Also, this moves around the images on the disk, so I had to move the
environment so it doesn't overwrite u-boot. The new env location works
with both boot methods.

Changes in v2:
 - Rebase after "Kconfig: Move CONFIG_SPL_..._SUPPORT to Kconfig."
 - Remove all the refactoring in the configs.
 - Split enabling featuring in rock2 into separate commit.

Sandy Patterson (2):
  Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.
  Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

 arch/arm/mach-rockchip/Kconfig | 3 +++
 configs/rock2_defconfig| 2 +-
 include/configs/rock2.h| 8 
 3 files changed, 8 insertions(+), 5 deletions(-)

-- 
1.9.1

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


[U-Boot] [PATCH v2 2/2] Enable ROCKCHIP_SPL_BACK_TO_BROM for rock2 board

2016-08-27 Thread Sandy Patterson
Rock2 has been tested with back to brom feature. The tricky part is that
with this feature the default environment is inside u-boot, and it's
defined for every rk3288 board independetly. So I just changed it for
rock2 here.

Solve by moving environment after u-boot before 1M boundary

Signed-off-by: Sandy Patterson 
---

Changes in v2: None

 include/configs/rock2.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/configs/rock2.h b/include/configs/rock2.h
index ee924c3..946367f 100644
--- a/include/configs/rock2.h
+++ b/include/configs/rock2.h
@@ -16,11 +16,11 @@
 
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
-/* SPL @ 32k for ~36k
- * ENV @ 96k
- * u-boot @ 128K
+/* SPL @ 32k for 34k
+ * u-boot directly after @ 68k for 400k or so
+ * ENV @ 992k
  */
-#define CONFIG_ENV_OFFSET (96 * 1024)
+#define CONFIG_ENV_OFFSET ((1024-32) * 1024)
 
 #define CONFIG_SYS_WHITE_ON_BLACK
 #define CONFIG_CONSOLE_SCROLL_LINES10
-- 
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/4] RK3288 needs fdt and initrd below 256M now.

2016-08-27 Thread Sandy Patterson
On Sat, Aug 27, 2016 at 12:06 PM, Simon Glass  wrote:

> Hi Sandy,
>
> On 11 July 2016 at 11:38, Sandy Patterson 
> wrote:
> > I am not sure why this limit is changing. But my kernel
> > doesn't load when it's above 256. This was testing on the
> > rock2 board.
> >
> > Signed-off-by: Sandy Patterson 
> > ---
> >
> >  include/configs/rk3288_common.h | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
>
> Is this patch not needed now?
>

I just retested with the latest from u-boot.git/master . This patch is
still required for booing on rock2. I tested with the same mainline kernel
version as before (4.7.0-rc6). I don't know why, and I haven't tried
searching back through the history to see if it used to work and what
changed, sorry.


>
> >
> > diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_
> common.h
> > index 9d50d83..b88e7e5 100644
> > --- a/include/configs/rk3288_common.h
> > +++ b/include/configs/rk3288_common.h
> > @@ -97,11 +97,11 @@
> >
> >  #include 
> >
> > -/* Linux fails to load the fdt if it's loaded above 512M on a Rock 2
> board, so
> > +/* Linux fails to load the fdt if it's loaded above 256M on a Rock 2
> board, so
> >   * limit the fdt reallocation to that */
> >  #define CONFIG_EXTRA_ENV_SETTINGS \
> > -   "fdt_high=0x1fff\0" \
> > -   "initrd_high=0x1fff\0" \
> > +   "fdt_high=0x0fff\0" \
> > +   "initrd_high=0x0fff\0" \
> > ENV_MEM_LAYOUT_SETTINGS \
> > ROCKCHIP_DEVICE_SETTINGS \
> > BOOTENV
> > --
> > 1.9.1
> >
>
> Regards,
> Simon
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

2016-08-24 Thread Sandy Patterson
On Wed, Aug 24, 2016 at 9:27 AM, Sandy Patterson 
wrote:

>
> On Fri, Aug 12, 2016 at 8:59 PM, Sandy Patterson <
> apatter...@sightlogix.com> wrote:
>
>> CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry,
>> so we can refactor the define into rk3288_common.h. Then only define it if
>> we are using using the Bootrom to load the non SPL U-Boot.
>>
>> With this change the SPL binary shrinks from 32k to 23k when
>> ROCKCHIP_SPL_BACK_TO_BROM is enabled. This has been tested on the rock2
>> board. It should work with any rk3288 though since the bootrom is
>> loading the SPL already it should load the main U-Boot as well.
>>
>> Rock2 has been tested with ROCKCHIP_SPL_BACK_TO_BROM So enabled for
>> rock2.
>>
>> Signed-off-by: Sandy Patterson 
>> ---
>>
>>  configs/rock2_defconfig| 1 +
>>  include/configs/chromebook_jerry.h | 1 +
>>  include/configs/evb_rk3288.h   | 2 --
>>  include/configs/fennec_rk3288.h| 2 --
>>  include/configs/firefly-rk3288.h   | 2 --
>>  include/configs/miniarm_rk3288.h   | 2 --
>>  include/configs/popmetal_rk3288.h  | 2 --
>>  include/configs/rk3288_common.h| 4 
>>  include/configs/rock2.h| 2 --
>>  9 files changed, 6 insertions(+), 12 deletions(-)
>>
>> diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
>> index 3b6d7d9..8f730e5 100644
>> --- a/configs/rock2_defconfig
>> +++ b/configs/rock2_defconfig
>> @@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
>>  CONFIG_USE_TINY_PRINTF=y
>>  CONFIG_CMD_DHRYSTONE=y
>>  CONFIG_ERRNO_STR=y
>> +CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
>> diff --git a/include/configs/chromebook_jerry.h
>> b/include/configs/chromebook_jerry.h
>> index d1f5b46..9800ffb 100644
>> --- a/include/configs/chromebook_jerry.h
>> +++ b/include/configs/chromebook_jerry.h
>> @@ -22,6 +22,7 @@
>>
>>  #define CONFIG_CMD_SF_TEST
>>
>> +#undef CONFIG_SPL_MMC_SUPPORT
>>  #undef CONFIG_SPL_GPIO_SUPPORT
>>
>>  #define CONFIG_KEYBOARD
>> diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
>> index 342557f..390c243 100644
>> --- a/include/configs/evb_rk3288.h
>> +++ b/include/configs/evb_rk3288.h
>> @@ -10,8 +10,6 @@
>>  #define ROCKCHIP_DEVICE_SETTINGS
>>  #include 
>>
>> -#define CONFIG_SPL_MMC_SUPPORT
>> -
>>  #define CONFIG_ENV_IS_IN_MMC
>>  #define CONFIG_SYS_MMC_ENV_DEV 1
>>  /* SPL @ 32k for ~36k
>> diff --git a/include/configs/fennec_rk3288.h
>> b/include/configs/fennec_rk3288.h
>> index 342557f..390c243 100644
>> --- a/include/configs/fennec_rk3288.h
>> +++ b/include/configs/fennec_rk3288.h
>> @@ -10,8 +10,6 @@
>>  #define ROCKCHIP_DEVICE_SETTINGS
>>  #include 
>>
>> -#define CONFIG_SPL_MMC_SUPPORT
>> -
>>  #define CONFIG_ENV_IS_IN_MMC
>>  #define CONFIG_SYS_MMC_ENV_DEV 1
>>  /* SPL @ 32k for ~36k
>> diff --git a/include/configs/firefly-rk3288.h
>> b/include/configs/firefly-rk3288.h
>> index a29f557..ee924c3 100644
>> --- a/include/configs/firefly-rk3288.h
>> +++ b/include/configs/firefly-rk3288.h
>> @@ -14,8 +14,6 @@
>>
>>  #include 
>>
>> -#define CONFIG_SPL_MMC_SUPPORT
>> -
>>  #define CONFIG_ENV_IS_IN_MMC
>>  #define CONFIG_SYS_MMC_ENV_DEV 0
>>  /* SPL @ 32k for ~36k
>> diff --git a/include/configs/miniarm_rk3288.h
>> b/include/configs/miniarm_rk3288.h
>> index 342557f..390c243 100644
>> --- a/include/configs/miniarm_rk3288.h
>> +++ b/include/configs/miniarm_rk3288.h
>> @@ -10,8 +10,6 @@
>>  #define ROCKCHIP_DEVICE_SETTINGS
>>  #include 
>>
>> -#define CONFIG_SPL_MMC_SUPPORT
>> -
>>  #define CONFIG_ENV_IS_IN_MMC
>>  #define CONFIG_SYS_MMC_ENV_DEV 1
>>  /* SPL @ 32k for ~36k
>> diff --git a/include/configs/popmetal_rk3288.h
>> b/include/configs/popmetal_rk3288.h
>> index 342557f..390c243 100644
>> --- a/include/configs/popmetal_rk3288.h
>> +++ b/include/configs/popmetal_rk3288.h
>> @@ -10,8 +10,6 @@
>>  #define ROCKCHIP_DEVICE_SETTINGS
>>  #include 
>>
>> -#define CONFIG_SPL_MMC_SUPPORT
>> -
>>  #define CONFIG_ENV_IS_IN_MMC
>>  #define CONFIG_SYS_MMC_ENV_DEV 1
>>  /* SPL @ 32k for ~36k
>> diff --git a/include/configs/rk3288_common.h
>> b/include/configs/rk3288_common.h
>> index d3d4c68..bc0de3d 100644
>> --- a/include/configs/rk3288_common.h
>> +++ b/include/configs/rk3288_common.h
>> @@ -33,6 +33,10 @@
>>  #define CONFIG_SYS_NS16550_MEM32
&

Re: [U-Boot] [PATCH] rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

2016-08-24 Thread Sandy Patterson
On Fri, Aug 12, 2016 at 8:59 PM, Sandy Patterson 
wrote:

> CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry,
> so we can refactor the define into rk3288_common.h. Then only define it if
> we are using using the Bootrom to load the non SPL U-Boot.
>
> With this change the SPL binary shrinks from 32k to 23k when
> ROCKCHIP_SPL_BACK_TO_BROM is enabled. This has been tested on the rock2
> board. It should work with any rk3288 though since the bootrom is
> loading the SPL already it should load the main U-Boot as well.
>
> Rock2 has been tested with ROCKCHIP_SPL_BACK_TO_BROM So enabled for
> rock2.
>
> Signed-off-by: Sandy Patterson 
> ---
>
>  configs/rock2_defconfig| 1 +
>  include/configs/chromebook_jerry.h | 1 +
>  include/configs/evb_rk3288.h   | 2 --
>  include/configs/fennec_rk3288.h| 2 --
>  include/configs/firefly-rk3288.h   | 2 --
>  include/configs/miniarm_rk3288.h   | 2 --
>  include/configs/popmetal_rk3288.h  | 2 --
>  include/configs/rk3288_common.h| 4 
>  include/configs/rock2.h| 2 --
>  9 files changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
> index 3b6d7d9..8f730e5 100644
> --- a/configs/rock2_defconfig
> +++ b/configs/rock2_defconfig
> @@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
>  CONFIG_USE_TINY_PRINTF=y
>  CONFIG_CMD_DHRYSTONE=y
>  CONFIG_ERRNO_STR=y
> +CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
> diff --git a/include/configs/chromebook_jerry.h
> b/include/configs/chromebook_jerry.h
> index d1f5b46..9800ffb 100644
> --- a/include/configs/chromebook_jerry.h
> +++ b/include/configs/chromebook_jerry.h
> @@ -22,6 +22,7 @@
>
>  #define CONFIG_CMD_SF_TEST
>
> +#undef CONFIG_SPL_MMC_SUPPORT
>  #undef CONFIG_SPL_GPIO_SUPPORT
>
>  #define CONFIG_KEYBOARD
> diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
> index 342557f..390c243 100644
> --- a/include/configs/evb_rk3288.h
> +++ b/include/configs/evb_rk3288.h
> @@ -10,8 +10,6 @@
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_
> rk3288.h
> index 342557f..390c243 100644
> --- a/include/configs/fennec_rk3288.h
> +++ b/include/configs/fennec_rk3288.h
> @@ -10,8 +10,6 @@
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/firefly-rk3288.h b/include/configs/firefly-
> rk3288.h
> index a29f557..ee924c3 100644
> --- a/include/configs/firefly-rk3288.h
> +++ b/include/configs/firefly-rk3288.h
> @@ -14,8 +14,6 @@
>
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 0
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_
> rk3288.h
> index 342557f..390c243 100644
> --- a/include/configs/miniarm_rk3288.h
> +++ b/include/configs/miniarm_rk3288.h
> @@ -10,8 +10,6 @@
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/popmetal_rk3288.h b/include/configs/popmetal_
> rk3288.h
> index 342557f..390c243 100644
> --- a/include/configs/popmetal_rk3288.h
> +++ b/include/configs/popmetal_rk3288.h
> @@ -10,8 +10,6 @@
>  #define ROCKCHIP_DEVICE_SETTINGS
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 1
>  /* SPL @ 32k for ~36k
> diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_
> common.h
> index d3d4c68..bc0de3d 100644
> --- a/include/configs/rk3288_common.h
> +++ b/include/configs/rk3288_common.h
> @@ -33,6 +33,10 @@
>  #define CONFIG_SYS_NS16550_MEM32
>  #define CONFIG_SPL_BOARD_INIT
>
> +#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
> +#define CONFIG_SPL_MMC_SUPPORT
> +#endif
> +
>  #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>  /* Bootrom will load u-boot binary to 0x0 once return from SPL */
>  #define CONFIG_SYS_TEXT_BASE   0x
> diff --git a/include/configs/rock2.h b/include/configs/rock2.h
> index a29f557..ee924c3 100644
> --- a/include/configs/rock2.h
> +++ b/include/configs/rock2.h
> @@ -14,8 +14,6 @@
>
>  #include 
>
> -#define CONFIG_SPL_MMC_SUPPORT
> -
>  #define CONFIG_ENV_IS_IN_MMC
>  #define CONFIG_SYS_MMC_ENV_DEV 0
>  /* SPL @ 32k for ~36k
> --
> 1.9.1
>
>

Hi Simon,

Just wondering if this commit got lost, or maybe there is some advice you
could give me on how to make this more helpful.

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


[U-Boot] [PATCH] rockchip: Disable SPL_MMC_SUPPORT if ROCKCHIP_SPL_BACK_TO_BROM is enabled.

2016-08-13 Thread Sandy Patterson
CONFIG_SPL_MMC_SUPPORT is used pretty much for every board except jerry,
so we can refactor the define into rk3288_common.h. Then only define it if
we are using using the Bootrom to load the non SPL U-Boot.

With this change the SPL binary shrinks from 32k to 23k when
ROCKCHIP_SPL_BACK_TO_BROM is enabled. This has been tested on the rock2
board. It should work with any rk3288 though since the bootrom is
loading the SPL already it should load the main U-Boot as well.

Rock2 has been tested with ROCKCHIP_SPL_BACK_TO_BROM So enabled for
rock2.

Signed-off-by: Sandy Patterson 
---

 configs/rock2_defconfig| 1 +
 include/configs/chromebook_jerry.h | 1 +
 include/configs/evb_rk3288.h   | 2 --
 include/configs/fennec_rk3288.h| 2 --
 include/configs/firefly-rk3288.h   | 2 --
 include/configs/miniarm_rk3288.h   | 2 --
 include/configs/popmetal_rk3288.h  | 2 --
 include/configs/rk3288_common.h| 4 
 include/configs/rock2.h| 2 --
 9 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index 3b6d7d9..8f730e5 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_ROCKCHIP_SPL_BACK_TO_BROM=y
diff --git a/include/configs/chromebook_jerry.h 
b/include/configs/chromebook_jerry.h
index d1f5b46..9800ffb 100644
--- a/include/configs/chromebook_jerry.h
+++ b/include/configs/chromebook_jerry.h
@@ -22,6 +22,7 @@
 
 #define CONFIG_CMD_SF_TEST
 
+#undef CONFIG_SPL_MMC_SUPPORT
 #undef CONFIG_SPL_GPIO_SUPPORT
 
 #define CONFIG_KEYBOARD
diff --git a/include/configs/evb_rk3288.h b/include/configs/evb_rk3288.h
index 342557f..390c243 100644
--- a/include/configs/evb_rk3288.h
+++ b/include/configs/evb_rk3288.h
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/fennec_rk3288.h b/include/configs/fennec_rk3288.h
index 342557f..390c243 100644
--- a/include/configs/fennec_rk3288.h
+++ b/include/configs/fennec_rk3288.h
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/firefly-rk3288.h b/include/configs/firefly-rk3288.h
index a29f557..ee924c3 100644
--- a/include/configs/firefly-rk3288.h
+++ b/include/configs/firefly-rk3288.h
@@ -14,8 +14,6 @@
 
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
diff --git a/include/configs/miniarm_rk3288.h b/include/configs/miniarm_rk3288.h
index 342557f..390c243 100644
--- a/include/configs/miniarm_rk3288.h
+++ b/include/configs/miniarm_rk3288.h
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/popmetal_rk3288.h 
b/include/configs/popmetal_rk3288.h
index 342557f..390c243 100644
--- a/include/configs/popmetal_rk3288.h
+++ b/include/configs/popmetal_rk3288.h
@@ -10,8 +10,6 @@
 #define ROCKCHIP_DEVICE_SETTINGS
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 1
 /* SPL @ 32k for ~36k
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index d3d4c68..bc0de3d 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -33,6 +33,10 @@
 #define CONFIG_SYS_NS16550_MEM32
 #define CONFIG_SPL_BOARD_INIT
 
+#ifndef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#define CONFIG_SPL_MMC_SUPPORT
+#endif
+
 #ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
 /* Bootrom will load u-boot binary to 0x0 once return from SPL */
 #define CONFIG_SYS_TEXT_BASE   0x
diff --git a/include/configs/rock2.h b/include/configs/rock2.h
index a29f557..ee924c3 100644
--- a/include/configs/rock2.h
+++ b/include/configs/rock2.h
@@ -14,8 +14,6 @@
 
 #include 
 
-#define CONFIG_SPL_MMC_SUPPORT
-
 #define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 /* SPL @ 32k for ~36k
-- 
1.9.1

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


Re: [U-Boot] disabling mmc in spl when booting using bootrom

2016-08-12 Thread Sandy Patterson
On Fri, Aug 12, 2016 at 1:20 PM, Simon Glass  wrote:

> Hi Ziyuan,
>
> On 11 August 2016 at 05:35, Ziyuan Xu  wrote:
> >
> >
> > On 2016年08月11日 19:31, Sandy Patterson wrote:
> >>
> >> Simon,
> >>
> >> I am trying to format a patch to disable MMC in the SPL if booting main
> >> u-boot using BOOTROM, therefore the SPL MMC isn't needed.
> >>
> >> Is the best solution to wrap every header file (rock2.h
> firefly-rk3288.h,
> >> etc) with ifdefs on the BACK_TO_BROM define? Or would it be better to
> move
> >> the SPL MMC define into rk3288-common.h and just have chromebook_jerry
> undef
> >> it like it does the SPL GPIO code.
> >>
> >> With that change, enabling BOOT_TO_BROM shrinks the spl from 32K to 23K.
> >
> > Note that, firefly-rk3288 use OF_PLATDATA, we will use
> u-boot-spl-no-dtb.bin
> > instead of u-boot-spl-dtb.bin, and the size of u-boot-spl-no-dtb.bin is
> > almost 23K.
> >
> > @Simon, I think we will update doc/README.rockchip if you insist on
> > OF_PLATDATA for firefly-rk3288. we no longer use u-boot-spl-dtb.bin.:-)
>
> I don't insist :-)
>
> I really don't like OF_PLATDATA. But it cuts the size down a lot
> (~6KB) and we are otherwise always running out of space on rk3288.
>
> If there is a better idea, let's have it. Otherwise, yes we can update the
> docs.
>

@Ziyuan, I did my testing on rock2 which doesn't use OF_PLATDATA, the
firefly
board should see the same final size which is roughly equivalent to the
current
firefly SPL size.

We ran out of space in SPL. I too was afraid of using OF_PLATDATA mostly
from
Simon's commit message.

I would propose moving to using the BOOTROM to load U-Boot proper. You
shouldn't
need any of the media drivers since the BOOTROM was already able to load
the SPL
it should be fine loading the full U-Boot.

I get 9K from removing MMC from rock2. I'm happy to write a patch that
applies this logic
to the remainder of the rk3288 boards if that's the way you'd like to go.
You could test it by
enabling the BOOT_TO_BROM config.


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


[U-Boot] disabling mmc in spl when booting using bootrom

2016-08-11 Thread Sandy Patterson
Simon,

I am trying to format a patch to disable MMC in the SPL if booting main
u-boot using BOOTROM, therefore the SPL MMC isn't needed.

Is the best solution to wrap every header file (rock2.h firefly-rk3288.h,
etc) with ifdefs on the BACK_TO_BROM define? Or would it be better to move
the SPL MMC define into rk3288-common.h and just have chromebook_jerry
undef it like it does the SPL GPIO code.

With that change, enabling BOOT_TO_BROM shrinks the spl from 32K to 23K.

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


Re: [U-Boot] disabling mmc in spl when booting using bootrom

2016-08-11 Thread Sandy Patterson
On Thu, Aug 11, 2016 at 7:35 AM, Ziyuan Xu  wrote:

>
>
> On 2016年08月11日 19:31, Sandy Patterson wrote:
>
>> Simon,
>>
>> I am trying to format a patch to disable MMC in the SPL if booting main
>> u-boot using BOOTROM, therefore the SPL MMC isn't needed.
>>
>> Is the best solution to wrap every header file (rock2.h firefly-rk3288.h,
>> etc) with ifdefs on the BACK_TO_BROM define? Or would it be better to move
>> the SPL MMC define into rk3288-common.h and just have chromebook_jerry
>> undef it like it does the SPL GPIO code.
>>
>> With that change, enabling BOOT_TO_BROM shrinks the spl from 32K to 23K.
>>
> Note that, firefly-rk3288 use OF_PLATDATA, we will use
> u-boot-spl-no-dtb.bin instead of u-boot-spl-dtb.bin, and the size of
> u-boot-spl-no-dtb.bin is almost 23K.
>

The patch would apply if OF_PLATDATA is used too (Although I haven't tested
it). It would just shrink the SPL more right because you don't need the MMC
driver. I wasn't planning to change any of the defconfigs.


>
> @Simon, I think we will update doc/README.rockchip if you insist on
> OF_PLATDATA for firefly-rk3288. we no longer use u-boot-spl-dtb.bin.:-)
>
>>
>> Sandy
>>
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] rockchip: Fix SPL console output when ROCKCHIP_SPL_BACK_TO_BROM is enabled

2016-08-11 Thread Sandy Patterson
On Wed, Aug 10, 2016 at 11:01 PM, Ziyuan Xu  wrote:

>
>
> On 2016年08月10日 22:21, Sandy Patterson wrote:
>
>> Move back_to_bootrom() call later in SPL init so that the console is
>> initialized and printouts happen.
>>
>> Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is no console
>> output from the SPL init stages.
>>
>> I wasn't sure exactly where this should happen, so if we are set to do
>> run spl_board_init, then go back to bootrom there after
>> preloader_console_init(). Otherwise fall back to old behavior of doing
>> it in board_init_f.
>>
> In fact, ROCKCHIP_SPL_BACK_TO_BROM's aim is to reduce SPL's size, and we
> can undef CONFIG_SPL_MMC_SUPPORT and other thing.
> The SPL only in charge of DDR initialization, so that boot rom could load
> u-boot to RAM.
> If you really need something output, you can enable EARYLY_UART in
> rk3288-board-spl.c:board_init_f().
> But the above is my own understanding.


EARLY_UART is a good tool, but this patch just fixes printouts. It's not
enabling or disabling any code compilation. The console init and version
information code is there. I just move the back_to_bootrom call later in
the SPL if that later point exits. You can still
disable CONFIG_SPL_BOARD_INIT and it will fall back to calling the bootrom
earlier.

We don't actually need that much space. We chose to use BOOT_TO_BROM
instead of disabling the console in SPL.

We disable CONFIG_SPL_MMC_SUPPORT in our production system within the
rock2.h file if CONFIG_SPL_MMC_SUPPORT. I'll submit another patch for that.
I think if boootrom is used then the mmc should be removed from spl. I'm
not really sure how the config system is supposed to work in this case.


>
>> Signed-off-by: Sandy Patterson 
>> ---
>>
>>   arch/arm/mach-rockchip/rk3288-board-spl.c | 5 -
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c
>> b/arch/arm/mach-rockchip/rk3288-board-spl.c
>> index e0d92a6..0c2d525 100644
>> --- a/arch/arm/mach-rockchip/rk3288-board-spl.c
>> +++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
>> @@ -206,7 +206,7 @@ void board_init_f(ulong dummy)
>> debug("DRAM init failed: %d\n", ret);
>> return;
>> }
>> -#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>> +#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) &&
>> !defined(CONFIG_SPL_BOARD_INIT)
>> back_to_bootrom();
>>   #endif
>>   }
>> @@ -273,6 +273,9 @@ void spl_board_init(void)
>> }
>> preloader_console_init();
>> +#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
>> +   back_to_bootrom();
>> +#endif
>> return;
>>   err:
>> printf("spl_board_init: Error %d\n", ret);
>>
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] rockchip: Fix SPL console output when ROCKCHIP_SPL_BACK_TO_BROM is enabled

2016-08-10 Thread Sandy Patterson
Move back_to_bootrom() call later in SPL init so that the console is
initialized and printouts happen.

Currently when ROCKCHIP_SPL_BACK_TO_BROM is enabled there is no console
output from the SPL init stages.

I wasn't sure exactly where this should happen, so if we are set to do
run spl_board_init, then go back to bootrom there after
preloader_console_init(). Otherwise fall back to old behavior of doing
it in board_init_f.

Signed-off-by: Sandy Patterson 
---

 arch/arm/mach-rockchip/rk3288-board-spl.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board-spl.c 
b/arch/arm/mach-rockchip/rk3288-board-spl.c
index e0d92a6..0c2d525 100644
--- a/arch/arm/mach-rockchip/rk3288-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3288-board-spl.c
@@ -206,7 +206,7 @@ void board_init_f(ulong dummy)
debug("DRAM init failed: %d\n", ret);
return;
}
-#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+#if defined(CONFIG_ROCKCHIP_SPL_BACK_TO_BROM) && 
!defined(CONFIG_SPL_BOARD_INIT)
back_to_bootrom();
 #endif
 }
@@ -273,6 +273,9 @@ void spl_board_init(void)
}
 
preloader_console_init();
+#ifdef CONFIG_ROCKCHIP_SPL_BACK_TO_BROM
+   back_to_bootrom();
+#endif
return;
 err:
printf("spl_board_init: Error %d\n", ret);
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2 3/3] CONFIG_EFI_LOADER breaks rock2 kernel loading

2016-08-08 Thread Sandy Patterson
I also found that once the barrier stuff was in, the EFI_LOADER change was
unnecessary.

On Mon, Aug 8, 2016 at 8:50 PM, Ziyuan Xu  wrote:

> Hi Simon,
>
> I think you can drop this patch due to it fixes by a78cd86 - ARM: Rework
> and correct barrier which Tom had merge it into u-boot/master.
>
>
> On 2016年08月09日 05:43, Simon Glass wrote:
>
>> Hi Sandy,
>>
>> On 22 July 2016 at 08:40, Sandy Patterson 
>> wrote:
>>
>>> The problem seems to be invalidate_icache_all() inside the runtime.
>>> This patch just disables EFI_LOADER for rock2 board.
>>>
>>> Signed-off-by: Sandy Patterson 
>>> ---
>>>
>>>   configs/rock2_defconfig | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>> Can you please give me an update on these patches? Did you discover
>> the root cause? What patches do you think need to be applied for this
>> release. I'd like to get a few more test reports too if possible.
>>
>> Regards,
>> Simon
>>
>>
>>
>>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: Rework and correct barrier definitions

2016-08-02 Thread Sandy Patterson
Works for me on rock2. Thanks for the fix.

Acked-by: Sandy Patterson 

On Mon, Aug 1, 2016 at 8:39 PM, Tom Rini  wrote:

> On Tue, Aug 02, 2016 at 08:37:19AM +0800, Ziyuan Xu wrote:
> > Hi Tom,
> >
> >
> > On 2016年08月02日 06:54, Tom Rini wrote:
> > >As part of testing booting Linux kernels on Rockchip devices, it was
> > >discovered by Ziyuan Xu and Sandy Patterson that we had multiple and for
> > >some cases incomplete isb definitions.  This was causing a failure to
> > >boot of the Linux kernel.
> > >
> > >In order to solve this problem as well as cover any corner cases that we
> > >may also have had a number of changes are made in order to consolidate
> > >things.  First,  now becomes the source of isb/dsb/dmb
> > >definitions.  This however introduces another complexity.  Due to
> > >needing to build SPL for 32bit tegra with -march=armv4 we need to borrow
> > >the __LINUX_ARM_ARCH__ logic from the Linux Kernel in a more complete
> > >form.  Move this from arch/arm/lib/Makefile to arch/arm/Makefile and add
> > >a comment about it.  Now that we can always know what the target CPU is
> > >capable off we can get always do the correct thing for the barrier.  The
> > >final part of this is that need to be consistent everywhere and call
> > >isb()/dsb()/dmb() and NOT call ISB/DSB/DMB in some cases and the
> > >function names in others.
> > >
> > >Reported-by: Ziyuan Xu 
> > >Reported-by: Sandy Patterson 
> > >Signed-off-by: Tom Rini 
> > Great, this rework is similar to linux kernel, and it's better than
> > what I did.  Moreover, it works for my rk3288 boards.
> > Tested-by: Ziyuan Xu 
> >
> > But please can you keep things in alpha order? See below.
>
> Sure, I'll re-work when applying or reposting if there's any other
> comments.  Thanks!
>
> --
> Tom
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] rockchip: rockchip, sdram-channel 0xff fix remaining dts

2016-07-28 Thread Sandy Patterson
Add an extra byte so that this data is not byteswapped.

Signed-off-by: Sandy Patterson 
---

 arch/arm/dts/rk3288-rock2-square.dts | 2 +-
 arch/arm/dts/rk3288-veyron.dtsi  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/dts/rk3288-rock2-square.dts 
b/arch/arm/dts/rk3288-rock2-square.dts
index 34073c9..2c30355 100644
--- a/arch/arm/dts/rk3288-rock2-square.dts
+++ b/arch/arm/dts/rk3288-rock2-square.dts
@@ -192,7 +192,7 @@
0x5 0x0>;
rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
0xa60 0x40 0x10 0x0>;
-   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 
0xff>;
rockchip,sdram-params = <0x30B25564 0x627 3 66600 3 9 1>;
 };
 
diff --git a/arch/arm/dts/rk3288-veyron.dtsi b/arch/arm/dts/rk3288-veyron.dtsi
index 421d212..d9d5187 100644
--- a/arch/arm/dts/rk3288-veyron.dtsi
+++ b/arch/arm/dts/rk3288-veyron.dtsi
@@ -253,7 +253,7 @@
0x5 0x0>;
rockchip,phy-timing = <0x48f9aab4 0xea0910 0x1002c200
0xa60 0x40 0x10 0x0>;
-   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf>;
+   rockchip,sdram-channel = /bits/ 8 <0x1 0xa 0x3 0x2 0x1 0x0 0xf 0xf 
0xff>;
rockchip,sdram-params = <0x30B25564 0x627 3 66600 3 9 1>;
 };
 
-- 
1.9.1

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


Re: [U-Boot] [PATCH] arm: re-implement proper ISB instruction for ARMv7-A

2016-07-28 Thread Sandy Patterson
Ziyuan,

I tested this patch and it works for me with the current u-boot.git/master.

Re the EFI support. The problem was that when you compile in efi_runtime.c
it breaks booting the kernel. Probably rubbing the caching system the wrong
way. With this patch we are able to boot the kernel with the EFI parts
compiled in. I don't believe anyone has tested the functionality of EFI
wtih rk3288.

Sandy Patterson

On Thu, Jul 28, 2016 at 8:03 AM, Ziyuan Xu  wrote:

> Hi Alexander,
>
> On 2016年07月28日 18:39, Alexander Graf wrote:
>
>> On 07/28/2016 12:13 PM, Ziyuan Xu wrote:
>>
>>> For ARMv7-A architecture, the valid ISB instruction is asm
>>> volatile("isb").
>>>
>>> This patch fixes the U-Boot was stuck in invalidate_dcache_all() before
>>> booting linux kernel, which occurred on rk3288-base development board
>>> such as evb-rk3288, rock2-rk3288. And something output via console like:
>>>
>>> => bootz 0x200
>>> 0x0200
>>> ramdisk start = 0x, ramdisk end = 0x
>>> Continuing to boot without FDT
>>> Initial value for argc=3
>>> Final value for argc=3
>>> using: ATAGS
>>>
>>> Starting kernel ...
>>>
>>> Linux kernel exactly the same way(see arch/arm/include/asm/barrier.h).
>>>
>>> Signed-off-by: Ziyuan Xu 
>>>
>>
>> Perfect! So with this, EFI support can still be in and things work fine?
>>
>
> I had not test EFI feature, in fact, I have no experience about it. Any
> progress I will promptly inform you.
>
>
>>
>> Alex
>>
>>
>>
>>
>>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [issue report] mainline u-boot was stuck before booting kernel

2016-07-26 Thread Sandy Patterson
Hi Ziyuan, good work!

This does in fact fix it for me.

I followed through your notes. What is isr() supposed to do? it looks like
it just tells the compiler that the memory cache has been invalidated. But
in the TRM it says we need to actually do an ISB.

Would fixing the dcache flush so it does an ISB when it disables the MMU
maybe be an alternative solution? (I couldn't figure out which macro I
should be using. isb() is defined for arm64 to do the actual op.

Anyway, the following also fixes for me.

diff --git a/arch/arm/lib/cache-cp15.c b/arch/arm/lib/cache-cp15.c
index 1121dc3..3494a5c 100644
--- a/arch/arm/lib/cache-cp15.c
+++ b/arch/arm/lib/cache-cp15.c
@@ -217,6 +217,8 @@ static void cache_disable(uint32_t cache_bit)
if (cache_bit == (CR_C | CR_M))
flush_dcache_all();
set_cr(reg & ~cache_bit);
+   if(cache_bit & CR_M)
+   asm volatile ("isb" : : : "memory");
 }
 #endif


I'm not sure what kinds of side effects for other boards these changes
would have.

On Tue, Jul 26, 2016 at 8:15 AM, Ziyuan Xu  wrote:

> + Simon and heiko
>
> On 2016年07月26日 14:30, Ziyuan Xu wrote:
>
>> Dear All,
>>
>> I add the ISB operation after dcache_disable(), and I can jump to linux
>> kernel entry.:-)
>>
>> diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
>> index 6eac5ef..5cc09ba 100644
>> --- a/arch/arm/cpu/armv7/cpu.c
>> +++ b/arch/arm/cpu/armv7/cpu.c
>> @@ -43,6 +43,7 @@ int cleanup_before_linux_select(int flags)
>> */
>> dcache_disable();
>> v7_outer_cache_disable();
>> +   ISB;
>>
>> /*
>> * After D-cache is flushed and before it is disabled
>> there may
>>
>> Sounds crazy. In fact, there is already an 'ISB' operation in set_cr()
>> which to disable dcache and MMU. But it just tell processor that  memory
>> had change, not real ISB for armv7.
>>
>> dcache_disable
>> ==>flush_dcache_all()
>> ==>set_cr()   disable dcache and MMU.
>>
>> #define isb() __asm__ __volatile__ ("" : : : "memory")
>> static inline void set_cr(unsigned int val)
>> {
>> if (is_hyp())
>> asm volatile("mcr p15, 4, %0, c1, c0, 0@ set CR" :
>>   : "r" (val)
>>   : "cc");
>> else
>> asm volatile("mcr p15, 0, %0, c1, c0, 0@ set CR" :
>>   : "r" (val)
>>   : "cc");
>> isb();
>> }
>>
>> I also find something in ARM cortex-A17 TRM. ==>"Disable the MMU from the
>> each processor followed by an ISB to ensure the MMU disable operation is
>> complete, then followed by a DSB to drain previous memory transactions."
>>
>> In my humble opinion, maybe instructions tlb had alter, and cause running
>> away??? I'm not sure about it.
>> @Sandy, could you have a try with my update?
>>
>> @Simon,  did you hit this glitch? I hope you can help ...:-)
>>
>> On 2016年07月25日 23:00, Sandy Patterson wrote:
>>
>>> Ah, thanks. Your debugging looks the same as what I've seen from printf
>>> debugging. I'll try to verify though.
>>>
>>> On Mon, Jul 25, 2016 at 10:58 AM, Ziyuan Xu >> <mailto:xzy...@rock-chips.com>> wrote:
>>>
>>> hi Stany,
>>>
>>> The difference is that you print out assertion log.
>>>
>>> Reset not supported on this platform
>>> ### ERROR ### Please RESET the board ###
>>>
>>> You can add show_boot_progress() function in your bsp file to find
>>> out something.
>>> #define CONFIG_SHOW_BOOT_PROGRESS
>>> void show_boot_progress(int progress)
>>> {
>>> printf("Boot reached stage %d\n", progress);
>>>
>>> }
>>>
>>>
>>> On 2016年07月25日 22:12, Ziyuan Xu wrote:
>>>
>>> Hi All,
>>>
>>> I'm sorry to tell you that I failed to boot linux kernel with
>>> the mainline u-boot on rk3288 board(both evb-rk3288 &
>>> fennec-rk3288). It was stuck in cleanup_before_linux() before
>>> jumping to linux, and the boot_stage_flag is
>>> BOOTSTAGE_ID_BOOTM_HANDOFF.
>>>
>>> ## Current stack ends at 0x7df638b0 *  kernel: cmdline image
>

Re: [U-Boot] [issue report] mainline u-boot was stuck before booting kernel

2016-07-25 Thread Sandy Patterson
Ah, thanks. Your debugging looks the same as what I've seen from printf
debugging. I'll try to verify though.

On Mon, Jul 25, 2016 at 10:58 AM, Ziyuan Xu  wrote:

> hi Stany,
>
> The difference is that you print out assertion log.
>
> Reset not supported on this platform
> ### ERROR ### Please RESET the board ###
>
> You can add show_boot_progress() function in your bsp file to find out
> something.
> #define CONFIG_SHOW_BOOT_PROGRESS
> void show_boot_progress(int progress)
> {
> printf("Boot reached stage %d\n", progress);
>
> }
>
>
> On 2016年07月25日 22:12, Ziyuan Xu wrote:
>
>> Hi All,
>>
>> I'm sorry to tell you that I failed to boot linux kernel with the
>> mainline u-boot on rk3288 board(both evb-rk3288 & fennec-rk3288). It was
>> stuck in cleanup_before_linux() before jumping to linux, and the
>> boot_stage_flag is BOOTSTAGE_ID_BOOTM_HANDOFF.
>>
>> ## Current stack ends at 0x7df638b0 *  kernel: cmdline image address =
>> 0x0200
>> ## No init Ramdisk
>>ramdisk start = 0x, ramdisk end = 0x
>> ## No Flattened Device Tree
>> Continuing to boot without FDT
>> Initial value for argc=3
>> Final value for argc=3
>> using: ATAGS
>> ## Transferring control to Linux (at address 0200)...
>>
>> Starting kernel ...
>>
>> With the further investigation, it never returnned back from
>> invalidate_dcache_all(). I mean that I can't reach stage 4 as below.
>>
>> cleanup_before_linux
>> ==>cleanup_before_linux_select
>> ==>1.disable_interrupts
>> ==>2.dcache_disable
>> ==>3.invalidate_dcache_all
>> ==>4.icache_disable
>>
>> Debug further, invalidate_dcache_all  invalidate all cache one-by-one
>> which cache type is DATA_ONLY, INSTRUCTION_DATA or UNIFIED. And invalidate
>> way from one set to another set in order. The problem is that the PC ran
>> away in invalidate way loop  [cache level L1!!!].
>>
>> I add some serial output code in __v7_flush_dcache_all to figure out the
>> bog.
>> I expect:
>> Print the value of r9 in sequence, e.g 0x7f, 0x7e, 0x7d. 0x01, 0x00
>> (hex)
>> In fact, print the value of r9 in sequence at first, but print unexpected
>> value afterwards.   e.g 0x7f, 0x7e, 0x7d, ..,0x73, 0x40, 0x85,
>>
>> ENTRY(__v7_flush_dcache_all)
>> [snip]
>> loop1:
>> movr9, r7@ create working copy of max index
>> loop2:
>> +  stmfdsp!, {r0}
>> +  ldr r0, =0xff69
>> +  str r9, [r0]
>> +  ldmfdsp!, {r0}
>>  ARM(orrr11, r10, r4, lsl r5)@ factor way and cache
>> number into r11
>>  THUMB(lslr6, r4, r5)
>>  THUMB(orrr11, r10, r6)@ factor way and cache number
>> into r11
>>  ARM(orrr11, r11, r9, lsl r2)@ factor index number into
>> r11
>>  THUMB(lslr6, r9, r2)
>>  THUMB(orrr11, r11, r6)@ factor index number into r11
>> mcrp15, 0, r11, c7, c14, 2@ clean & invalidate by set/way
>> subsr9, r9, #1@ decrement the index
>> bgeloop2
>> subsr4, r4, #1@ decrement the way
>> bgeloop1
>> skip:
>> ENDPROC(__v7_flush_dcache_all)
>>
>> I don't have the jtag, hence I can't address the current pc. I have no
>> doubt that if any glitches in __v7_flush_dcache_all, I reviewed several
>> times, also copy kernel's implement to here. :-( No effect.
>> A more interesting thing is that Sandy had report it.  He and I have
>> similar problem. Everything work fine after I applied his patches, or
>> disable dcache(active CONFIG_SYS_DCACHE_OFF).
>> @Stany, I'm sorry that I disable dcache during hack.. That was a
>> mistake:-(
>>
>> @Simon & hieko,
>> Can you boot linux with the mainline u-boot? have a try?
>>
>>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> http://lists.denx.de/mailman/listinfo/u-boot
>>
>>
>>
>>
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL) with asm code"

2016-07-22 Thread Sandy Patterson
I see the problem with 4.7-rc6. Is there a different kernel I should test
with?

On Fri, Jul 22, 2016 at 4:39 PM, Tom Rini  wrote:

> On Fri, Jul 22, 2016 at 10:40:11AM -0400, Sandy Patterson wrote:
>
> > Commit c09d29057a and df120142f36 break kernel loading on rock2 board.
> >
> > console output:
> > Starting kernel ...
> >
> > ### ERROR ### Please RESET the board ###
> >
> > This reverts commit c09d29057ab0b04db0857d319c6bff74de31b9c3.
> >
> > Conflicts:
> >   arch/arm/cpu/armv7/cache_v7.c
> >   arch/arm/cpu/armv7/cache_v7_asm.S
> >
> > Signed-off-by: Sandy Patterson 
>
> So, we cannot do this.  The problem is two-fold.  First, newer GCCs will
> cause failure to boot with the way the code was, which is how we found
> this problem.  The second is that after some offline conversations with
> ARM Ltd people (and some other smart folks too, these operations cannot
> safely be done in C, there's just no way.  So we borrowed what the
> kernel does.  You need to figure out what behavior the (old?) kernel is
> relying on and either emulate that with a flag (like sunxi does, or at
> least did, at one point for some other issues of correct behavior vs
> existing kernels) or just not support those older kernels.
>
> --
> Tom
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/3] CONFIG_EFI_LOADER breaks rock2 kernel loading

2016-07-22 Thread Sandy Patterson
The problem seems to be invalidate_icache_all() inside the runtime.
This patch just disables EFI_LOADER for rock2 board.

Signed-off-by: Sandy Patterson 
---

 configs/rock2_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index 3e16b80..3a06b7e 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+# CONFIG_EFI_LOADER is not set
-- 
1.9.1

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


[U-Boot] [PATCH v2 0/3] Fix loading kernel on RK3288 Radxa Rock2 Square

2016-07-22 Thread Sandy Patterson

I wasn't able to load the linux kernel using a Rock2 board
using the latest master branch. The board hangs after it has
handed executing over to the kernel. I found that the latest release
that worked was v2016.03.

This patchset fixes kernel loading on rk3288 rock2 square board.
I tested with with 3.14 adn 4.7-rc6 kernels.
I used gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabi.

Before fixing, the console output was:

Starting kernel ...

### ERROR ### Please RESET the board ###

Changes for v2:
 - Remove patch to change to high mem limit.
 - Rebase to u-boot/master.


Sandy Patterson (3):
  Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL)
with asm code"
  Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with
asm code"
  CONFIG_EFI_LOADER breaks rock2 kernel loading

 arch/arm/cpu/armv7/Makefile  |   2 +-
 arch/arm/cpu/armv7/cache_v7.c| 134 ++-
 arch/arm/cpu/armv7/cache_v7_asm.S| 154 ---
 arch/arm/mach-uniphier/arm32/lowlevel_init.S |  67 +++-
 configs/rock2_defconfig  |   1 +
 5 files changed, 198 insertions(+), 160 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/cache_v7_asm.S

-- 
1.9.1

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


[U-Boot] [PATCH v2 2/3] Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with asm code"

2016-07-22 Thread Sandy Patterson
Commit c09d29057a and df120142f36 break kernel loading on rock2 board.

console output:
Starting kernel ...

### ERROR ### Please RESET the board ###

This reverts commit df120142f36b6ff8b12187b8860269763b2b3203.

Conflicts:
arch/arm/cpu/armv7/cache_v7.c
arch/arm/cpu/armv7/cache_v7_asm.S

Signed-off-by: Sandy Patterson 
---

 arch/arm/cpu/armv7/cache_v7.c | 20 +---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index 9fbabb4..e72bed5 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -10,8 +10,10 @@
 #include 
 #include 
 
-#define ARMV7_DCACHE_INVAL_RANGE   1
-#define ARMV7_DCACHE_CLEAN_INVAL_RANGE 2
+#define ARMV7_DCACHE_INVAL_ALL 1
+#define ARMV7_DCACHE_CLEAN_INVAL_ALL   2
+#define ARMV7_DCACHE_INVAL_RANGE   3
+#define ARMV7_DCACHE_CLEAN_INVAL_RANGE 4
 
 #ifndef CONFIG_SYS_DCACHE_OFF
 
@@ -19,6 +21,18 @@
 void v7_flush_dcache_all(void);
 void v7_invalidate_dcache_all(void);
 
+/*
+ * Write the level and type you want to Cache Size Selection Register(CSSELR)
+ * to get size details from Current Cache Size ID Register(CCSIDR)
+ */
+static void set_csselr(u32 level, u32 type)
+{
+   u32 csselr = level << 1 | type;
+
+   /* Write to Cache Size Selection Register(CSSELR) */
+   asm volatile ("mcr p15, 2, %0, c0, c0, 0" : : "r" (csselr));
+}
+
 static u32 get_ccsidr(void)
 {
u32 ccsidr;
@@ -207,7 +221,7 @@ static void v7_inval_tlb(void)
 
 void invalidate_dcache_all(void)
 {
-   v7_invalidate_dcache_all();
+   v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
 
v7_outer_cache_inval_all();
 }
-- 
1.9.1

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


[U-Boot] [PATCH v2 1/3] Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL) with asm code"

2016-07-22 Thread Sandy Patterson
Commit c09d29057a and df120142f36 break kernel loading on rock2 board.

console output:
Starting kernel ...

### ERROR ### Please RESET the board ###

This reverts commit c09d29057ab0b04db0857d319c6bff74de31b9c3.

Conflicts:
arch/arm/cpu/armv7/cache_v7.c
arch/arm/cpu/armv7/cache_v7_asm.S

Signed-off-by: Sandy Patterson 
---

 arch/arm/cpu/armv7/Makefile  |   2 +-
 arch/arm/cpu/armv7/cache_v7.c| 114 +++-
 arch/arm/cpu/armv7/cache_v7_asm.S| 154 ---
 arch/arm/mach-uniphier/arm32/lowlevel_init.S |  67 +++-
 4 files changed, 180 insertions(+), 157 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/cache_v7_asm.S

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 0d4bfbc..9d20f17 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -7,7 +7,7 @@
 
 extra-y:= start.o
 
-obj-y  += cache_v7.o cache_v7_asm.o
+obj-y  += cache_v7.o
 
 obj-y  += cpu.o cp15.o
 obj-y  += syslib.o
diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index 52f1856..9fbabb4 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -28,6 +28,118 @@ static u32 get_ccsidr(void)
return ccsidr;
 }
 
+static u32 get_clidr(void)
+{
+   u32 clidr;
+
+   /* Read current CP15 Cache Level ID Register */
+   asm volatile ("mrc p15,1,%0,c0,c0,1" : "=r" (clidr));
+   return clidr;
+}
+
+static void v7_inval_dcache_level_setway(u32 level, u32 num_sets,
+u32 num_ways, u32 way_shift,
+u32 log2_line_len)
+{
+   int way, set;
+   u32 setway;
+
+   /*
+* For optimal assembly code:
+*  a. count down
+*  b. have bigger loop inside
+*/
+   for (way = num_ways - 1; way >= 0 ; way--) {
+   for (set = num_sets - 1; set >= 0; set--) {
+   setway = (level << 1) | (set << log2_line_len) |
+(way << way_shift);
+   /* Invalidate data/unified cache line by set/way */
+   asm volatile (" mcr p15, 0, %0, c7, c6, 2"
+   : : "r" (setway));
+   }
+   }
+   /* DSB to make sure the operation is complete */
+   DSB;
+}
+
+static void v7_clean_inval_dcache_level_setway(u32 level, u32 num_sets,
+  u32 num_ways, u32 way_shift,
+  u32 log2_line_len)
+{
+   int way, set;
+   u32 setway;
+
+   /*
+* For optimal assembly code:
+*  a. count down
+*  b. have bigger loop inside
+*/
+   for (way = num_ways - 1; way >= 0 ; way--) {
+   for (set = num_sets - 1; set >= 0; set--) {
+   setway = (level << 1) | (set << log2_line_len) |
+(way << way_shift);
+   /*
+* Clean & Invalidate data/unified
+* cache line by set/way
+*/
+   asm volatile (" mcr p15, 0, %0, c7, c14, 2"
+   : : "r" (setway));
+   }
+   }
+   /* DSB to make sure the operation is complete */
+   DSB;
+}
+
+static void v7_maint_dcache_level_setway(u32 level, u32 operation)
+{
+   u32 ccsidr;
+   u32 num_sets, num_ways, log2_line_len, log2_num_ways;
+   u32 way_shift;
+
+   set_csselr(level, ARMV7_CSSELR_IND_DATA_UNIFIED);
+
+   ccsidr = get_ccsidr();
+
+   log2_line_len = ((ccsidr & CCSIDR_LINE_SIZE_MASK) >>
+   CCSIDR_LINE_SIZE_OFFSET) + 2;
+   /* Converting from words to bytes */
+   log2_line_len += 2;
+
+   num_ways  = ((ccsidr & CCSIDR_ASSOCIATIVITY_MASK) >>
+   CCSIDR_ASSOCIATIVITY_OFFSET) + 1;
+   num_sets  = ((ccsidr & CCSIDR_NUM_SETS_MASK) >>
+   CCSIDR_NUM_SETS_OFFSET) + 1;
+   /*
+* According to ARMv7 ARM number of sets and number of ways need
+* not be a power of 2
+*/
+   log2_num_ways = log_2_n_round_up(num_ways);
+
+   way_shift = (32 - log2_num_ways);
+   if (operation == ARMV7_DCACHE_INVAL_ALL) {
+   v7_inval_dcache_level_setway(level, num_sets, num_ways,
+way_shift, log2_line_len);
+   } else if (operation == ARMV7_DCACHE_CLEAN_INVAL_ALL) {
+   v7_clean_inval_dcache_level_setway(level, num_sets, num_ways,
+  way_shift, log2_line_len);
+   }
+}
+
+static void v7_maint_dcache_all(u32

Re: [U-Boot] [PATCH 0/4] Ability to load linux kernel on rock2 RK3288

2016-07-22 Thread Sandy Patterson
Ziyuan,

I retested the kernel loading. I'm using 3.14 kernel. I also tested with
linux-4.7-rc6. I still require both the cache reverts and disabling
efi_loader on u-boot/master and u-boot-rockchip/master. (see below for
testing parameters)

Hans,
I have been unable to boot an RK3288 rock2 square board since v2016.03
release. The kernel fails to start.

Before reverting I get this on my console:

Starting kernel ...

### ERROR ### Please RESET the board ###

Another possibly related problem which has similar effect without the ERROR
potion above is a call to invalidate_icache_all() from efi_runtime.c.
Commenting out this line or disabled CONFIG_EFI_LOADER seems to allow the
kernel to boot.

testing:
board: radxa rock2 square
kernel: 3.14 custom, and linux-4.7-rc6 - multi_v7_defconfig zImage
rk3288-radxa-rock.dtb
toolchain: gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabi
loading from sd card - the actual loading seems fine though. I'm not sure
how emmc would change anything.

booting command for 4.7 (we use and care about 3.14, but i thought it would
be easier to show with 4.7-rc6. I get the same behavior with 3.14):
setenv bootargs root=/dev/mmcblk0p4
ext4load mmc 0:3 0x0200 /zImage; ext4load mmc 0:3 0x01f0
/rk3288-rock2-square.dtb
bootz 0x0200 - 0x01f0

u-boot/master: 95d52733036af7438a5285d729d53844ec48c63e
CONFIG_EFI_LOADER=n and cache reverts required to load kernel
*_high changes don't seem to be required anymore

u-boot-rockchip: 1781acd31b01225402167fbdb8fa97157cc269eb
CONFIG_EFI_LOADER=n and cache reverts required to load kernel
*_high changes don't seem to be required anymore

Sandy Patterson


On Thu, Jul 21, 2016 at 11:21 PM, Simon Glass  wrote:

> +Hans, Tom
>
> Hi Sandy,
>
> On 15 July 2016 at 07:40, Sandy Patterson 
> wrote:
> > Hi Simon,
> >
> > I think I screwed up submitting, and didn't cc the maintainers for the
> > reverts. I can resubmit and get patman to behave. What do you suggest?
> >
> > I still think this is the best patch to getting rock2 to load kernels
> again.
> >
> > I just retested with a patch specific to my kernel. I think 3.14 linux
> has
> > some quirks in how it wants the dram setup, and I get instability without
> > some changes to the dram init. I don't have enough of a system to test
> for
> > this instability using the latest mainline kernel, so I left that patch
> out.
> >
> > Ziyuan had an alternative fix for efi_loader, but it looks like it may
> break
> > efi_loader for others, and I don't know how to test the efi
> functionality,
> > so I think disabling for RK3288 is best. I think I should move the
> > CONFIG_EFI_LOADER patch to somehow patching rk3288_common.h instead (can
> I
> > #undef config vars in that file?)
>
> Yes please can you resend and cc the maintainers and original author.
> Patman -t should do this automatically.
>
> Also with the revert of Han's ARM patches, please can you describe the
> problem so it is clear why we need to revert?
>
> Regards,
> Simon
>
> [...]
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/4] Ability to load linux kernel on rock2 RK3288

2016-07-15 Thread Sandy Patterson
Hi Simon,

I think I screwed up submitting, and didn't cc the maintainers for the
reverts. I can resubmit and get patman to behave. What do you suggest?

I still think this is the best patch to getting rock2 to load kernels again.

I just retested with a patch specific to my kernel. I think 3.14 linux has
some quirks in how it wants the dram setup, and I get instability without
some changes to the dram init. I don't have enough of a system to test for
this instability using the latest mainline kernel, so I left that patch out.

Ziyuan had an alternative fix for efi_loader, but it looks like it may
break efi_loader for others, and I don't know how to test the efi
functionality, so I think disabling for RK3288 is best. I think I should
move the CONFIG_EFI_LOADER patch to somehow patching rk3288_common.h
instead (can I #undef config vars in that file?)

Sandy



On Thu, Jul 14, 2016 at 11:19 PM, Simon Glass  wrote:

> HI Sandy,
>
> On 13 July 2016 at 11:51, Sandy Patterson 
> wrote:
> > I did a little more on this, and talked to someone else here. It seems
> that
> > my problem with loading the kernel including these patches is specific to
> > our kernel and after applying a local patch we have, it appears to load
> > fine.
> >
> > So this patchset gets me back to the same functionality in v2016.03.
> >
> > We're left with the puzzle of what's wrong on the RK3288 regarding
> caching
> > and memory.
>
> So what is the status of this patch set? Should it be withdrawn?
>
> Regards,
> Simon
>
> >
> > Sandy Patterson
> >
> > On Mon, Jul 11, 2016 at 1:38 PM, Sandy Patterson <
> apatter...@sightlogix.com>
> > wrote:
> >>
> >> I wasn't able to load the linux kernel using a Rock2 board
> >> using the latest master branch. The board hangs after it has
> >> handed executing over to the kernel. I found that the latest release
> >> that worked was v2016.03.
> >>
> >> I did some searching and I suspect the problem may be cache related.
> >>
> >> This patchset allows the kernel to start by reverting two problem
> >> commits and disabling EFI_LOADER which I suspect rubs the caching the
> >> wrong way. We also found that the 512M limit for fdt and initrd is now
> >> 256M.
> >> I'm not sure why this is.
> >>
> >> This still doesn't work 100%. I think it's not initializing the SD card
> >> volages correctly, but at least the Kernel is loading.
> >>
> >> I also am not sure changing the caching for all armv7 is the right
> >> answer. I wasn't too sure about the revert. I am not very familiar with
> >> this low level stuff.
> >>
> >> Sandy Patterson
> >>
> >>
> >> Sandy Patterson (4):
> >>   Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL)
> >> with asm code"
> >>   Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with
> >> asm code"
> >>   Disable CONFIG_EFI_LOADER for rock2.
> >>   RK3288 needs fdt and initrd below 256M now.
> >>
> >>  arch/arm/cpu/armv7/Makefile  |   2 +-
> >>  arch/arm/cpu/armv7/cache_v7.c| 135
> >> ++-
> >>  arch/arm/cpu/armv7/cache_v7_asm.S| 154
> >> ---
> >>  arch/arm/mach-uniphier/arm32/lowlevel_init.S |  67 +++-
> >>  configs/rock2_defconfig  |   1 +
> >>  include/configs/rk3288_common.h  |   6 +-
> >>  6 files changed, 201 insertions(+), 164 deletions(-)
> >>  delete mode 100644 arch/arm/cpu/armv7/cache_v7_asm.S
> >>
> >> --
> >> 1.9.1
> >>
> >
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/4] Ability to load linux kernel on rock2 RK3288

2016-07-14 Thread Sandy Patterson
I did a little more on this, and talked to someone else here. It seems that
my problem with loading the kernel including these patches is specific to
our kernel and after applying a local patch we have, it appears to load
fine.

So this patchset gets me back to the same functionality in v2016.03.

We're left with the puzzle of what's wrong on the RK3288 regarding caching
and memory.

Sandy Patterson

On Mon, Jul 11, 2016 at 1:38 PM, Sandy Patterson 
wrote:

> I wasn't able to load the linux kernel using a Rock2 board
> using the latest master branch. The board hangs after it has
> handed executing over to the kernel. I found that the latest release
> that worked was v2016.03.
>
> I did some searching and I suspect the problem may be cache related.
>
> This patchset allows the kernel to start by reverting two problem
> commits and disabling EFI_LOADER which I suspect rubs the caching the
> wrong way. We also found that the 512M limit for fdt and initrd is now
> 256M.
> I'm not sure why this is.
>
> This still doesn't work 100%. I think it's not initializing the SD card
> volages correctly, but at least the Kernel is loading.
>
> I also am not sure changing the caching for all armv7 is the right
> answer. I wasn't too sure about the revert. I am not very familiar with
> this low level stuff.
>
> Sandy Patterson
>
>
> Sandy Patterson (4):
>   Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL)
> with asm code"
>   Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with
> asm code"
>   Disable CONFIG_EFI_LOADER for rock2.
>   RK3288 needs fdt and initrd below 256M now.
>
>  arch/arm/cpu/armv7/Makefile  |   2 +-
>  arch/arm/cpu/armv7/cache_v7.c| 135 ++-
>  arch/arm/cpu/armv7/cache_v7_asm.S| 154
> ---
>  arch/arm/mach-uniphier/arm32/lowlevel_init.S |  67 +++-
>  configs/rock2_defconfig  |   1 +
>  include/configs/rk3288_common.h  |   6 +-
>  6 files changed, 201 insertions(+), 164 deletions(-)
>  delete mode 100644 arch/arm/cpu/armv7/cache_v7_asm.S
>
> --
> 1.9.1
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/4] Disable CONFIG_EFI_LOADER for rock2.

2016-07-11 Thread Sandy Patterson
I'm not sure why this breaks kernel loading.

Signed-off-by: Sandy Patterson 
---

 configs/rock2_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index 3e16b80..3a06b7e 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+# CONFIG_EFI_LOADER is not set
-- 
1.9.1

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


[U-Boot] [PATCH 4/4] RK3288 needs fdt and initrd below 256M now.

2016-07-11 Thread Sandy Patterson
I am not sure why this limit is changing. But my kernel
doesn't load when it's above 256. This was testing on the
rock2 board.

Signed-off-by: Sandy Patterson 
---

 include/configs/rk3288_common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index 9d50d83..b88e7e5 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -97,11 +97,11 @@
 
 #include 
 
-/* Linux fails to load the fdt if it's loaded above 512M on a Rock 2 board, so
+/* Linux fails to load the fdt if it's loaded above 256M on a Rock 2 board, so
  * limit the fdt reallocation to that */
 #define CONFIG_EXTRA_ENV_SETTINGS \
-   "fdt_high=0x1fff\0" \
-   "initrd_high=0x1fff\0" \
+   "fdt_high=0x0fff\0" \
+   "initrd_high=0x0fff\0" \
ENV_MEM_LAYOUT_SETTINGS \
ROCKCHIP_DEVICE_SETTINGS \
BOOTENV
-- 
1.9.1

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


[U-Boot] [PATCH 2/4] Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with asm code"

2016-07-11 Thread Sandy Patterson
This reverts commit df120142f36b6ff8b12187b8860269763b2b3203.

Conflicts:
arch/arm/cpu/armv7/cache_v7.c
arch/arm/cpu/armv7/cache_v7_asm.S

Signed-off-by: Sandy Patterson 
---

 arch/arm/cpu/armv7/cache_v7.c | 24 +---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index 85b0b0e..3e1ea2c 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -10,10 +10,16 @@
 #include 
 #include 
 
-#define ARMV7_DCACHE_INVAL_RANGE   1
-#define ARMV7_DCACHE_CLEAN_INVAL_RANGE 2
+#define ARMV7_DCACHE_INVAL_ALL 1
+#define ARMV7_DCACHE_CLEAN_INVAL_ALL   2
+#define ARMV7_DCACHE_INVAL_RANGE   3
+#define ARMV7_DCACHE_CLEAN_INVAL_RANGE 4
 
 #ifndef CONFIG_SYS_DCACHE_OFF
+
+/* Asm functions from cache_v7_asm.S */
+void v7_flush_dcache_all(void);
+
 static int check_cache_range(unsigned long start, unsigned long stop)
 {
int ok = 1;
@@ -31,6 +37,18 @@ static int check_cache_range(unsigned long start, unsigned 
long stop)
return ok;
 }
 
+/*
+ * Write the level and type you want to Cache Size Selection Register(CSSELR)
+ * to get size details from Current Cache Size ID Register(CCSIDR)
+ */
+static void set_csselr(u32 level, u32 type)
+{
+   u32 csselr = level << 1 | type;
+
+   /* Write to Cache Size Selection Register(CSSELR) */
+   asm volatile ("mcr p15, 2, %0, c0, c0, 0" : : "r" (csselr));
+}
+
 static u32 get_ccsidr(void)
 {
u32 ccsidr;
@@ -238,7 +256,7 @@ static void v7_inval_tlb(void)
 
 void invalidate_dcache_all(void)
 {
-   v7_invalidate_dcache_all();
+   v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL);
 
v7_outer_cache_inval_all();
 }
-- 
1.9.1

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


[U-Boot] [PATCH 1/4] Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL) with asm code"

2016-07-11 Thread Sandy Patterson
This reverts commit c09d29057ab0b04db0857d319c6bff74de31b9c3.

Conflicts:
arch/arm/cpu/armv7/cache_v7.c
arch/arm/cpu/armv7/cache_v7_asm.S

Signed-off-by: Sandy Patterson 
---

 arch/arm/cpu/armv7/Makefile  |   2 +-
 arch/arm/cpu/armv7/cache_v7.c| 119 +++--
 arch/arm/cpu/armv7/cache_v7_asm.S| 154 ---
 arch/arm/mach-uniphier/arm32/lowlevel_init.S |  67 +++-
 4 files changed, 180 insertions(+), 162 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/cache_v7_asm.S

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index ddd8d12..34bd42b 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -7,7 +7,7 @@
 
 extra-y:= start.o
 
-obj-y  += cache_v7.o cache_v7_asm.o
+obj-y  += cache_v7.o
 
 obj-y  += cpu.o cp15.o
 obj-y  += syslib.o
diff --git a/arch/arm/cpu/armv7/cache_v7.c b/arch/arm/cpu/armv7/cache_v7.c
index dc309da..85b0b0e 100644
--- a/arch/arm/cpu/armv7/cache_v7.c
+++ b/arch/arm/cpu/armv7/cache_v7.c
@@ -14,11 +14,6 @@
 #define ARMV7_DCACHE_CLEAN_INVAL_RANGE 2
 
 #ifndef CONFIG_SYS_DCACHE_OFF
-
-/* Asm functions from cache_v7_asm.S */
-void v7_flush_dcache_all(void);
-void v7_invalidate_dcache_all(void);
-
 static int check_cache_range(unsigned long start, unsigned long stop)
 {
int ok = 1;
@@ -45,6 +40,118 @@ static u32 get_ccsidr(void)
return ccsidr;
 }
 
+static u32 get_clidr(void)
+{
+   u32 clidr;
+
+   /* Read current CP15 Cache Level ID Register */
+   asm volatile ("mrc p15,1,%0,c0,c0,1" : "=r" (clidr));
+   return clidr;
+}
+
+static void v7_inval_dcache_level_setway(u32 level, u32 num_sets,
+u32 num_ways, u32 way_shift,
+u32 log2_line_len)
+{
+   int way, set;
+   u32 setway;
+
+   /*
+* For optimal assembly code:
+*  a. count down
+*  b. have bigger loop inside
+*/
+   for (way = num_ways - 1; way >= 0 ; way--) {
+   for (set = num_sets - 1; set >= 0; set--) {
+   setway = (level << 1) | (set << log2_line_len) |
+(way << way_shift);
+   /* Invalidate data/unified cache line by set/way */
+   asm volatile (" mcr p15, 0, %0, c7, c6, 2"
+   : : "r" (setway));
+   }
+   }
+   /* DSB to make sure the operation is complete */
+   DSB;
+}
+
+static void v7_clean_inval_dcache_level_setway(u32 level, u32 num_sets,
+  u32 num_ways, u32 way_shift,
+  u32 log2_line_len)
+{
+   int way, set;
+   u32 setway;
+
+   /*
+* For optimal assembly code:
+*  a. count down
+*  b. have bigger loop inside
+*/
+   for (way = num_ways - 1; way >= 0 ; way--) {
+   for (set = num_sets - 1; set >= 0; set--) {
+   setway = (level << 1) | (set << log2_line_len) |
+(way << way_shift);
+   /*
+* Clean & Invalidate data/unified
+* cache line by set/way
+*/
+   asm volatile (" mcr p15, 0, %0, c7, c14, 2"
+   : : "r" (setway));
+   }
+   }
+   /* DSB to make sure the operation is complete */
+   DSB;
+}
+
+static void v7_maint_dcache_level_setway(u32 level, u32 operation)
+{
+   u32 ccsidr;
+   u32 num_sets, num_ways, log2_line_len, log2_num_ways;
+   u32 way_shift;
+
+   set_csselr(level, ARMV7_CSSELR_IND_DATA_UNIFIED);
+
+   ccsidr = get_ccsidr();
+
+   log2_line_len = ((ccsidr & CCSIDR_LINE_SIZE_MASK) >>
+   CCSIDR_LINE_SIZE_OFFSET) + 2;
+   /* Converting from words to bytes */
+   log2_line_len += 2;
+
+   num_ways  = ((ccsidr & CCSIDR_ASSOCIATIVITY_MASK) >>
+   CCSIDR_ASSOCIATIVITY_OFFSET) + 1;
+   num_sets  = ((ccsidr & CCSIDR_NUM_SETS_MASK) >>
+   CCSIDR_NUM_SETS_OFFSET) + 1;
+   /*
+* According to ARMv7 ARM number of sets and number of ways need
+* not be a power of 2
+*/
+   log2_num_ways = log_2_n_round_up(num_ways);
+
+   way_shift = (32 - log2_num_ways);
+   if (operation == ARMV7_DCACHE_INVAL_ALL) {
+   v7_inval_dcache_level_setway(level, num_sets, num_ways,
+ way_shift, log2_line_len);
+   } else if (operation == ARMV7_DCACHE_CLEAN_INVAL_ALL) {
+   v7_clean_inval_dcache_level_setway(level, num_sets, num_way

[U-Boot] [PATCH 0/4] Ability to load linux kernel on rock2 RK3288

2016-07-11 Thread Sandy Patterson
I wasn't able to load the linux kernel using a Rock2 board
using the latest master branch. The board hangs after it has
handed executing over to the kernel. I found that the latest release
that worked was v2016.03.

I did some searching and I suspect the problem may be cache related.

This patchset allows the kernel to start by reverting two problem
commits and disabling EFI_LOADER which I suspect rubs the caching the
wrong way. We also found that the 512M limit for fdt and initrd is now 256M.
I'm not sure why this is.

This still doesn't work 100%. I think it's not initializing the SD card
volages correctly, but at least the Kernel is loading.

I also am not sure changing the caching for all armv7 is the right
answer. I wasn't too sure about the revert. I am not very familiar with
this low level stuff.

Sandy Patterson


Sandy Patterson (4):
  Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_CLEAN_INVAL_ALL)
with asm code"
  Revert "arm: Replace v7_maint_dcache_all(ARMV7_DCACHE_INVAL_ALL) with
asm code"
  Disable CONFIG_EFI_LOADER for rock2.
  RK3288 needs fdt and initrd below 256M now.

 arch/arm/cpu/armv7/Makefile  |   2 +-
 arch/arm/cpu/armv7/cache_v7.c| 135 ++-
 arch/arm/cpu/armv7/cache_v7_asm.S| 154 ---
 arch/arm/mach-uniphier/arm32/lowlevel_init.S |  67 +++-
 configs/rock2_defconfig  |   1 +
 include/configs/rk3288_common.h  |   6 +-
 6 files changed, 201 insertions(+), 164 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/cache_v7_asm.S

-- 
1.9.1

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


[U-Boot] Radxa Rock2 square bug report (kernel won't load)

2016-06-29 Thread Sandy Patterson
Hi,

I am attempting to use U-Boot on a radxa rock2 board, and noticed that the
latest release of u-boot doesn't allow the kernel to boot. I am including a
boot log below.

I was able to get a working u-boot which boots my kernel by compiling
v2016.03. (git://git.denx.de/u-boot.git)

I traced a bit and found two commits which seem to break things, but I
stopped there.

1) ed980b8c62fbe17052ec6151a68b5b0be3809485
after this commit I am able to get a working uboot with this patch:

diff --git a/configs/rock2_defconfig b/configs/rock2_defconfig
index fd32fb5..c2780c4 100644
--- a/configs/rock2_defconfig
+++ b/configs/rock2_defconfig
@@ -67,3 +67,4 @@ CONFIG_USE_PRIVATE_LIBGCC=y
 CONFIG_USE_TINY_PRINTF=y
 CONFIG_CMD_DHRYSTONE=y
 CONFIG_ERRNO_STR=y
+CONFIG_EFI_LOADER=n


2) c09d29057ab0b04db0857d319c6bff74de31b9c3

I wasn't able to find a solution here.

I am using this toolchain:
android-platform-prebuilts-gcc-linux-x86-arm-arm-eabi-4.6 Is there a better
option for u-boot in general?

I'm able to test and do some limited troubleshooting, but I don't think I
can delve into dram init assembly code. I believe that v2016.03 is
sufficient for our purposes, so this isn't critical for us. Just a friendly
bug report.

Good luck,
Sandy Patterson


U-Boot SPL 2016.05 (Jun 28 2016 - 09:57:30)
Trying to boot from MMC1


I see a similar log in master:
U-Boot 2016.05 (Jun 28 2016 - 09:57:30 -0400)

Model: Radxa Rock 2 Square
DRAM:  2 GiB
MMC:   dwmmc@ff0f: 0, dwmmc@ff0c: 1
** First descriptor is NOT a primary desc on 0:1 **
stdio_add_devices: Video device failed (ret=-19)
In:serial
Out:   serial
Err:   serial
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0
5244128 bytes read in 390 ms (12.8 MiB/s)
41982 bytes read in 14 ms (2.9 MiB/s)
10534400 bytes read in 775 ms (13 MiB/s)
Kernel image @ 0x200 [ 0x00 - 0x5004e0 ]
## Flattened Device Tree blob at 01f0
   Booting using the fdt blob at 0x1f0
   Loading Ramdisk to 1f5f4000, end 1e00 ... OK
   Loading Device Tree to 1f5e6000, end 1f5f33fd ... OK

Starting kernel ...

Reset not supported on this platform
### ERROR ### Please RESET the board ###
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot