Re: [U-Boot] [PATCH v2] ARM: tegra: enable ums on nyan boards

2019-02-14 Thread Tristan Bastian

Am 15.02.2019 00:42 schrieb Stephen Warren :
>
> On 2/14/19 4:25 PM, Tristan Bastian wrote: 
> > This patch enables UMS on the nyan devices like the nyan-big. 
> > A patch like this has been sent in by Stephen Warren some time ago for 
> > other tegra devices: commit e6607cffef965011ef0ddc0fbe6f4b7c0d53aeec 
> > But the nyan devices never received that functionality. 
> > 
> > v2: fixed corrupted patch 
>
> That should be below the ---, but I assume Tom can fix that when 
> applying the patch. 
>
> Acked-by: Stephen Warren  
> but... 
>
> > diff --git a/arch/arm/dts/tegra124-nyan.dtsi 
> > b/arch/arm/dts/tegra124-nyan.dtsi 
> > index 51895e4816..2b28fe1497 100644 
> > --- a/arch/arm/dts/tegra124-nyan.dtsi 
> > +++ b/arch/arm/dts/tegra124-nyan.dtsi 
> > @@ -414,6 +414,7 @@ 
> >   
> >   usb@7d00 { /* Rear external USB port. */ 
> >   status = "okay"; 
> > + dr_mode = "otg"; 
> >   nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>; 
> >   }; 
>
> Do you also need to add aliases for the USB nodes, like I did in my 
> similar patch: 
>
> > diff --git a/arch/arm/dts/tegra124-jetson-tk1.dts 
> > b/arch/arm/dts/tegra124-jetson-tk1.dts 
> > index 52e8c0e59c6b..464287e03ecf 100644 
> > --- a/arch/arm/dts/tegra124-jetson-tk1.dts 
> > +++ b/arch/arm/dts/tegra124-jetson-tk1.dts 
> > @@ -17,7 +17,8 @@ 
> > sdhci1 = "/sdhci@700b0400"; 
> > spi0 = "/spi@7000d400"; 
> > spi1 = "/spi@7000da00"; 
> > -   usb0 = "/usb@7d008000"; 
> > +   usb0 = "/usb@7d00"; 
> > +   usb1 = "/usb@7d008000"; 
> > }; 

At least for nyan-big this is done in the: tegra124-nyan-big.dts file.
So there is no need to also do this here.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2] ARM: tegra: enable ums on nyan boards

2019-02-14 Thread Tristan Bastian
This patch enables UMS on the nyan devices like the nyan-big.
A patch like this has been sent in by Stephen Warren some time ago for other 
tegra devices: commit e6607cffef965011ef0ddc0fbe6f4b7c0d53aeec
But the nyan devices never received that functionality.

v2: fixed corrupted patch

Signed-off-by: Tristan Bastian 

---
 arch/arm/dts/tegra124-nyan.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/tegra124-nyan.dtsi b/arch/arm/dts/tegra124-nyan.dtsi
index 51895e4816..2b28fe1497 100644
--- a/arch/arm/dts/tegra124-nyan.dtsi
+++ b/arch/arm/dts/tegra124-nyan.dtsi
@@ -414,6 +414,7 @@
 
usb@7d00 { /* Rear external USB port. */
status = "okay";
+   dr_mode = "otg";
nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
};
 
-- 
2.19.1

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


[U-Boot] [PATCH] ARM: tegra: enable ums on nyan boards

2019-02-14 Thread Tristan Bastian

This patch enables UMS on the nyan devices like the nyan-big.
A patch like this has been sent in by Stephen Warren some time ago for 
other tegra devices: commit e6607cffef965011ef0ddc0fbe6f4b7c0d53aeec

But the nyan devices never received that functionality.

Signed-off-by: Tristan Bastian 

---
arch/arm/dts/tegra124-nyan.dtsi | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/dts/tegra124-nyan.dtsi 
b/arch/arm/dts/tegra124-nyan.dtsi

index 51895e4816..2b28fe1497 100644
--- a/arch/arm/dts/tegra124-nyan.dtsi
+++ b/arch/arm/dts/tegra124-nyan.dtsi
@@ -414,6 +414,7 @@

usb@7d00 { /* Rear external USB port. */
status = "okay";
+ dr_mode = "otg";
nvidia,vbus-gpio = <&gpio TEGRA_GPIO(N, 4) GPIO_ACTIVE_HIGH>;
};

--
2.19.1


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


[U-Boot] [REGRESSION] tegra: efi: EFI boot on nyan-big/tegra124 not possible

2019-02-14 Thread Tristan Bastian

Hello,

On my nyan-big Chromebook(tegra124) efi booting is broken since stable 
v2019.01.

v2018.11 is working fine..

I'm not sure if other tegra devices are working or not..

I'm getting the following output with u-boot v2019.01 if I try to start 
grub-efi-arm to boot ubuntu:


[...]

67482 bytes read in 17 ms (3.8 MiB/s)
Found EFI removable media binary efi/boot/bootarm.efi
Error: Cannot set up EFI drivers, r = 14
87040 bytes read in 12 ms (6.9 MiB/s)
Error: Cannot set up EFI drivers, r = 14
EFI LOAD FAILED: continuing...

[...]

The same setup is working if I use the v2018.11 branch.

Any ideas?

Tristan


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


Re: [U-Boot] [PATCH 1/2] nyan-big: change spi delay

2019-02-14 Thread Tristan Bastian

Hi Jon, Hi Stephen,

could you take a look at these two patches since I didn't get heard 
anything from Tom..


Thanks,
Tristan

Am 21.01.19 um 22:55 schrieb Simon Glass:

On Thu, 17 Jan 2019 at 10:33, Simon Glass  wrote:

On Wed, 16 Jan 2019 at 11:50, Tristan Bastian  wrote:

Internal keyboard of nyan-big is only working when cold booting by pressing 
[reload/refresh]+[power] button.
With this patch keyboard is working by only pressing [power] button.

Signed-off-by: Tristan Bastian 
---
  arch/arm/dts/tegra124-nyan-big-u-boot.dtsi | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass 

Adding Tom to apply this as he was not on the original email.


- Simon

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


Re: [U-Boot] [REGRESSION] tegra124: nyan-big: LPAE not working

2019-02-11 Thread Tristan Bastian


Am 11.02.19 um 11:48 schrieb Thierry Reding:

On Mon, Feb 11, 2019 at 10:04:37AM +, Tristan Bastian wrote:



Thierry Reding – Mon, 11. February 2019 10:38

On Mon, Feb 11, 2019 at 09:20:33AM +, Tristan Bastian wrote:

Thierry Reding – Mon, 11. February 2019 9:52

On Sun, Feb 10, 2019 at 08:53:11PM +0100, Tristan Bastian wrote:

Thierry, do you have any news on this?

I don't think, that google is going to push an updated version of

coreboot

to each nyan-big device..
So reverting this patch at least for the nyan devices would be the best

I

think..

Yes, I agree. I had a brief chat with Rob Herring about this and he too
agrees that we should revert it for now. I'll make it a manual revert
and add a comment to the device tree node that will hopefully avoid any
future janitorial "cleanups" of this sort.

great news! :)


BTW: I'm now running u-boot natively and it seems like u-boot always has

a

problem with the memory..
If u-boot is used chainloaded to coreboot it is only getting 2GB of

memory

and running u-boot natively also just gives me 2GB..
I've tested that with a kernel with "ARM: tegra: Fix unit_address_vs_reg

DTC

warnings for /memory" reverted and also on a kernel, before this patch

was

applied..

It's possible that U-Boot doesn't support LPAE and therefore may not be
able to use more than the 2 GiB of memory.

So I at least enabled LPAE in u-boot with "CONFIG_ARMV7_LPAE=y" and
this was for some reason also needed to get some output on the
display..
I'm not sure why LPAE needs to activated in u-boot for display output
on the nyan-big..
Without LPAE enabled u-boot was still working, and booted linux, but
u-boot didn't display anything on screen, linux then did..

Yeah, that's surprising. Perhaps without LPAE U-Boot thinks there's not
enough memory for the framebuffer? There should be plenty, so maybe
there is something else going on here.


However, U-Boot should be
able to tell the kernel exactly how much memory the system has and pass
that on via device tree. That still does work, right?

It seems like this is not working..
And this seems to be the case with both, u-boot chainloaded and
running u-boot natively..

I've used these scripts for flashing:
github.com/NVIDIA/tegra-uboot-flasher-scripts
And used the norrin device since it seems like it is the nyan-big dev
board?
But going with the norrin device config should not be the issue here
since the problem also exists when chainloading u-boot, right?

It could be a problem. The memory bank configuration is stored in what's
called a BCT along with a bunch of other parameters that define what the
memory controller needs to access the given memory chips. So if you've
flashed a BCT that's for a board with only 2 GiB of memory you would end
up with a system that can't address any more than that. It's somewhat
surprising that memory accesses work at all with a BCT that's for
different memory chips, but sometimes you can get lucky.

You may want to try reflashing with the right BCT. The simplest would
probably be to duplicate the cbootimage configuration for Norrin and
substitute the relevant bits by what you have from the Chromebook flash
utilities. Looks like the BCT in really the only thing you can replace
there. Make sure to replace it with the one that matches your Chromebook
and it should give you the right memory bank configuration.

Is there a way to check if the correct bct for my 4GB model was used?
What I tried was to edit the existing bct config file of norrin from here:
https://github.com/NVIDIA/cbootimage-configs/blob/master/tegra124/nvidia/norrin/PM370_Hynix_2GB_H5TC4G63AFR_PBA_924MHz_01212014.bct.cfg
by replacing all entries for each memory bank with the entries from here:
https://github.com/coreboot/coreboot/blob/master/src/mainboard/google/nyan_big/bct/sdram-hynix-4GB-792.inc

I also added the SDRAM[0], SDRAM[1], SDRAM[2], SDRAM[3] each time in front of 
each line..
This also booted for me, but also just leaves me with only 2Gb of my 4GB..

And since this problem also occurs, when chainloading u-boot, this must be a 
problem with u-boot, I think..

Not necessarily. U-Boot reads the memory size from EMC registers and
those EMC registers are programmed based on the contents of the BCT. So
if the BCT is wrong, then it's going to be wrong irrespective of what
bootloader you use.

That said, I does indeed look as if U-Boot only supports 2 GiB of memory
on 32-bit Tegra. arch/arm/mach-tegra/board.c contains the relevant code.
If you look at dram_init() it uses query_sdram_size() to get the size of
RAM. That will allow to convey up to 4 GiB of RAM, but then the code in
board2.c (see dram_init_banksize()) only uses a single bank on 32-bit
Tegra (CONFIG_PHYS_64BIT is only set for 64-bit Tegra).


I've enabled "CONFIG_PHYS_64BIT" for testing and it seems to be at least 
helping.
I'm gettin

Re: [U-Boot] [PATCH] cros: Expand the Chromium OS documentation

2019-02-08 Thread Tristan Bastian
Hi Simon,


Simon Glass – Fri, 8. February 2019 5:12
> Hi Tristan,
> 
> On Mon, 4 Feb 2019 at 08:01, Tristan Bastian  wrote:
> >
> > Hi Simon,
> >
> > I'm using the nyan-big chromebook (tegra124).
> > Is it possible to replace coreboot + depthcharge with just u-boot on the
> internal spi flash?
> > If so, do you have some instructions for that?
> 
> Possibly, although I would suggest being careful about that. Make sure
> you have a tool to revert the flash contents. Note that you will not
> have signed firmware so won't get updates. Presumably you are in dev
> mode anyway,

I've already got myself a SOIC flash clip and was able to extract the current 
content of the spi flash.
 
> The instructions are just to flash the image.bin file that comes out
> of the build, once it exists. But there is no chromeos_nyan target as
> yet. So your only option right now is to build an image without
> verified boot, and use a script to boot Chrome OS. I have not tried on
> this nyan.

I'm not sure to which file you are referring to, since there is no image.bin 
file..
If I build u-boot with this command: "make -j4 O=b/nyan-big nyan-big_defconfig 
all"
I'm getting these dot bin files:
-rw-r--r-- 1 tristan tristan 691K Feb  8 08:09 u-boot.bin
-rw-r--r-- 1 tristan tristan 691K Feb  8 08:09 u-boot-dtb.bin
-rw-r--r-- 1 tristan tristan  16M Feb  8 08:09 u-boot-dtb-tegra.bin
-rwxr-xr-x 1 tristan tristan 639K Feb  8 08:09 u-boot-nodtb.bin
-rw-r--r-- 1 tristan tristan  16M Feb  8 08:09 u-boot-nodtb-tegra.bin
-rw-r--r-- 1 tristan tristan  16M Feb  8 08:09 u-boot-tegra.bin

I would only be able to flash one of these files with flashrom to the spi chip 
if the file size equals the flash size..
I thought the 16MB files would be right, but nyan-big only has a flash size of 
about 4M..

The spi flash size seems to be configured in "include/configs/nyan-big.h" with:
#define CONFIG_SPI_FLASH_SIZE (4 << 20)
Which is the correct flash size (4194304)..

So should u-boot output a binary that I'm able to flash directly to the spi 
chip or are there some additional steps needed?
If so, could you give me some hints on what to do?

> > At the moment I'm chainloading u-boot, but this is causing some issues with
> not working LPAE so I'm only getting 2 of my 4GB of memory..
> > So I would like to try and run u-boot natively to see if chainloading is the
> problem or u-boot itself..
> > Or maybe you have some instructions to run coreboot + u-boot without
> depthcharge?
> 
> I suppose you could put U-Boot in the image in instead of dc and it might
> work.
Sorry for asking, but do you have some instructions for replacing dc?

Thanks,
Tristan
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] cros: Expand the Chromium OS documentation

2019-02-04 Thread Tristan Bastian
Hi Simon,

I'm using the nyan-big chromebook (tegra124).
Is it possible to replace coreboot + depthcharge with just u-boot on the 
internal spi flash?
If so, do you have some instructions for that?

At the moment I'm chainloading u-boot, but this is causing some issues with not 
working LPAE so I'm only getting 2 of my 4GB of memory..
So I would like to try and run u-boot natively to see if chainloading is the 
problem or u-boot itself..
Or maybe you have some instructions to run coreboot + u-boot without 
depthcharge?

Thanks,
Tristan


Simon Glass – Thu, 31. January 2019 4:52
> The current documentation only covers how to chain-load U-Boot on a
> Chromebook. Add more information about the other ways to use U-Boot on
> Chromebooks.
> 
> In particular it is again possible to build it with Chromium OS
> verified boot.
> 
> Signed-off-by: Simon Glass 
> ---
> 
> doc/README.chromium | 296 ++
> doc/README.chromium-chainload | 239 +++
> 2 files changed, 356 insertions(+), 179 deletions(-)
> create mode 100644 doc/README.chromium-chainload
> 
> diff --git a/doc/README.chromium b/doc/README.chromium
> index 45eaeced2d..096bc4f1f7 100644
> --- a/doc/README.chromium
> +++ b/doc/README.chromium
> @@ -1,239 +1,177 @@
> -Running U-Boot from coreboot on Chromebooks
> -===
> +Chromium OS Support in U-Boot
> +=
> 
> -U-Boot can be used as a secondary boot loader in a few situations such as
> from
> -UEFI and coreboot (see README.x86). Recent Chromebooks use coreboot even on
> -ARM platforms to start up the machine.
> +Introduction
> +
> 
> -This document aims to provide a guide to booting U-Boot on a Chromebook. It
> -is only a starting point, and there are many guides on the interwebs. But
> -placing this information in the U-Boot tree should make it easier to find for
> -those who use U-Boot habitually.
> +This describes how to use U-Boot with Chromium OS. Several options are
> +available:
> 
> -Most of these platforms are supported by U-Boot natively, but it is risky to
> -replace the ROM unless you have a servo board and cable to restore it with.
> + - Running U-Boot from the 'altfw' feature, which is available on selected
> + Chromebooks from 2019 onwards (initially Grunt). Press '1' from the
> + developer-mode screen to get into U-Boot. See here for details:
> + 
> sites.google.com/a/chromium.org/dev/chromium-os/poking-around-your-chrome-os-device
> 
> + - Running U-Boot from the disk partition. This involves signing U-Boot and
> + placing it on the disk, for booting as a 'kernel'. See
> + README.chromium-chainload for information on this. This is the only
> + option on non-U-Boot Chromebooks from 2013 to 2018 and is somewhat
> + more involved.
> 
> -For all of these the standard U-Boot build instructions apply. For example on
> -ARM:
> + - Running U-Boot with Chromium OS verified boot. This allows U-Boot to be
> + used instead of either or both of depthcharge (a bootloader which forked
> + from U-Boot in 2013) and coreboot. See below for more information on
> + this.
> 
> - sudo apt install gcc-arm-linux-gnueabi
> - mkdir b
> - make O=b/nyan_big CROSS_COMPILE=arm-linux-gnueabi- nyan-big_defconfig all
> 
> -You can obtain the vbutil_kernel utility here:
> +U-Boot with Chromium OS verified boot
> +-
> 
> - drive.google.com/open
> +To obtain:
> 
> + git clone github.com/sglass68/u-boot.git
> + cd u-boot
> + git checkout cros-master
> 
> -Snow (Samsung ARM Chromebook)
> --
> +To build for sandbox:
> 
> -See here:
> + UB=/tmp/b/chromeos_sandbox # U-Boot build directory
> + CROS=/home/sglass/cosarm # Chromium OS directory
> + make O=$UB/chromeos_sandbox_defconfig
> + make O=$UB -j20 -s VBOOT_SOURCE=$CROS/src/platform/vboot_reference \
> + MAKEFLAGS_VBOOT=DEBUG=1 QUIET=1
> 
> -
> www.chromium.org/chromium-os/firmware-porting-guide/using-nv-u-boot-on-the-samsung-arm-chromebook
> +Replace sandbox with another supported target.
> 
> +This produces $UB/image.bin which contains the firmware binaries in a SPI
> +flash image.
> 
> -Nyan-big
> -
> -
> -Compiled based on information here:
> -lists.denx.de/pipermail/u-boot/2015-March/209530.html
> -git.collabora.com/cgit/user/tomeu/u-boot.git/commit/
> -lists.denx.de/pipermail/u-boot/2017-May/289491.html
> -github.com/chromeos-nvidia-androidtv/gnu-linux-on-acer-chromebook-13
> -
> -1. Build U-Boot
> -
> - mkdir b
> - make -j8 O=b/nyan-big CROSS_COMPILE=arm-linux-gnueabi- nyan-big_defconfig
> all
> -
> -
> -2. Select a .its file
> -
> -Select something from doc/chromium which matches your board, or create your
> -own.
> -
> -Note that the device tree node is required, even though it is not actually
> -used by U-Boot. This is because the Chromebook expects to pass it to the
> -kernel, and crashes if it is not present.
> -
> -
> -3. Build and sign an image
> -
> - ./b/nyan-big/to

[U-Boot] [PATCH 0/2] Make nyan-big working..

2019-01-16 Thread Tristan Bastian
Another problem is, that the internal keyboard is not working on the current 
master.
A change of the SPI deactive delay solves that.
A workaround for the current master was to press [reload/refresh]+[power] 
button.
With the second patch this is no longer needed.

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


[U-Boot] [PATCH 2/2] nyan-big: add padding to its file

2019-01-16 Thread Tristan Bastian
Without this padding nyan-big ends at a blank screen on boot.
Details on how to get to this padding can be found in the README.chromium under 
Notes.

Signed-off-by: Tristan Bastian 
---
 doc/chromium/nyan-big.its | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/chromium/nyan-big.its b/doc/chromium/nyan-big.its
index 37d4e10949..bd412915e9 100644
--- a/doc/chromium/nyan-big.its
+++ b/doc/chromium/nyan-big.its
@@ -6,7 +6,7 @@
 
images {
kernel {
-   description = "U-Boot mainline";
+   description = "U-Boot mainline";
type = "kernel_noload";
arch = "arm";
os = "linux";
-- 
2.19.1

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


[U-Boot] [PATCH 1/2] nyan-big: change spi delay

2019-01-16 Thread Tristan Bastian
Internal keyboard of nyan-big is only working when cold booting by pressing 
[reload/refresh]+[power] button.
With this patch keyboard is working by only pressing [power] button.

Signed-off-by: Tristan Bastian 
---
 arch/arm/dts/tegra124-nyan-big-u-boot.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi 
b/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
index 3ff2f67c1a..ddfeba806c 100644
--- a/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
+++ b/arch/arm/dts/tegra124-nyan-big-u-boot.dtsi
@@ -15,7 +15,7 @@
};
 
spi@7000d400 {
-   spi-deactivate-delay = <200>;
+   spi-deactivate-delay = <500>;
spi-max-frequency = <300>;
 
cros_ec: cros-ec@0 {
-- 
2.19.1

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