All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] flashing and testing u-boot on chromebook_bob
@ 2019-11-18  5:33 Sahaj Sarup
  2019-11-18  5:46 ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Sahaj Sarup @ 2019-11-18  5:33 UTC (permalink / raw)
  To: u-boot

Hi All,

I was wondering if you could answer a few questions regarding u-boot
on Asus CP101 gru/bob ?

- To test the u-boot image following README.chromium-chainload,
should I expect output on the display or do I need
CDD/SuzyQable Cable for serial?

- The CONFIG_SYS_TEXT_BASE is currently 0x00200000 but
shouldn't it be CONFIG_SYS_TEXT_BASE=0x20000100
since its supposed to match CONFIG_KERNEL_START
from /chromiumos/platform/depthcharge/board/gru/defconfig

- In order to flash to spi, what's the procedure?


-- 
Best Regards
Sahaj Sarup

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

* [U-Boot] flashing and testing u-boot on chromebook_bob
  2019-11-18  5:33 [U-Boot] flashing and testing u-boot on chromebook_bob Sahaj Sarup
@ 2019-11-18  5:46 ` Simon Glass
       [not found]   ` <CAGW0CY6c35P=UPd68sG3nfxv6CDsLu3v4hds34gYair_3RU1cg@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2019-11-18  5:46 UTC (permalink / raw)
  To: u-boot

Hi Sahaj,

On Sun, 17 Nov 2019 at 21:33, Sahaj Sarup <sahajsarup@gmail.com> wrote:
>
> Hi All,
>
> I was wondering if you could answer a few questions regarding u-boot
> on Asus CP101 gru/bob ?
>
> - To test the u-boot image following README.chromium-chainload,
> should I expect output on the display or do I need
> CDD/SuzyQable Cable for serial?

The display should work OK. I don't think that device supports CCD.

>
> - The CONFIG_SYS_TEXT_BASE is currently 0x00200000 but
> shouldn't it be CONFIG_SYS_TEXT_BASE=0x20000100
> since its supposed to match CONFIG_KERNEL_START
> from /chromiumos/platform/depthcharge/board/gru/defconfig

Yes it is a bit annoying because the in-house bootloader doesn't
support FIT properly. As I recall you have to set it to the exact
address that it appears in the FIT.

>
> - In order to flash to spi, what's the procedure?

The chain load option doesn't use SPI flash. You actually sign the
image and put it into the kernel partition.

Not much help for you, but there is a new feature on more recent
Chromebooks called 'altfw' (alternative firmware) and if enabled, it
lets you press 1 to boot U-Boot (only in dev mode). It only works on
x86 devices so far and even then the device support is pretty basic if
it boots at all. But the good thing is that you can put things into
the altfw partition in SPI flash and they will boot without affecting
the device.

Regards,
Simon

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

* [U-Boot] flashing and testing u-boot on chromebook_bob
       [not found]   ` <CAGW0CY6c35P=UPd68sG3nfxv6CDsLu3v4hds34gYair_3RU1cg@mail.gmail.com>
@ 2019-11-19  1:21     ` Simon Glass
       [not found]       ` <CAGW0CY5WLBDyQJ60+68ZxJLuZRZSptjW+orrbxCb1XXovM4ZJw@mail.gmail.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Simon Glass @ 2019-11-19  1:21 UTC (permalink / raw)
  To: u-boot

Hi Sahaj,

On Mon, 18 Nov 2019 at 00:09, Sahaj Sarup <sahajsarup@gmail.com> wrote:
>
> see in-line...
>
> On Mon, 18 Nov 2019 at 11:16, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Sahaj,
> >
> > On Sun, 17 Nov 2019 at 21:33, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> > >
> > > Hi All,
> > >
> > > I was wondering if you could answer a few questions regarding u-boot
> > > on Asus CP101 gru/bob ?
> > >
> > > - To test the u-boot image following README.chromium-chainload,
> > > should I expect output on the display or do I need
> > > CDD/SuzyQable Cable for serial?
> >
> > The display should work OK. I don't think that device supports CCD.
>
> Well since the display is blank and the uboot.bin and uboot.fit have
> a correct 0x100 offset, I'll need to wait for my CCD cable to arrive.
> Bob in fact supports ccd:
> https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
> Although, i am confused as well since edp is supported, at least in
> the dts files.

Then I suspect it is broken.

>
> >
> > >
> > > - The CONFIG_SYS_TEXT_BASE is currently 0x00200000 but
> > > shouldn't it be CONFIG_SYS_TEXT_BASE=0x20000100
> > > since its supposed to match CONFIG_KERNEL_START
> > > from /chromiumos/platform/depthcharge/board/gru/defconfig
> >
> > Yes it is a bit annoying because the in-house bootloader doesn't
> > support FIT properly. As I recall you have to set it to the exact
> > address that it appears in the FIT.
> >
> > >
> > > - In order to flash to spi, what's the procedure?
> >
> > The chain load option doesn't use SPI flash. You actually sign the
> > image and put it into the kernel partition.
> >
>
> I know...
>
> > Not much help for you, but there is a new feature on more recent
> > Chromebooks called 'altfw' (alternative firmware) and if enabled, it
> > lets you press 1 to boot U-Boot (only in dev mode). It only works on
> > x86 devices so far and even then the device support is pretty basic if
> > it boots at all. But the good thing is that you can put things into
> > the altfw partition in SPI flash and they will boot without affecting
> > the device.
> >
>
> hmm.. but what about the whole remove the secure screw procedure and
> enable flash writes?

Not needed if you are chain loading, nor with altfw.

You can use it if you build a raw U-Boot, but need a way of recovering it!


> I know vaguely about it.

Regards,
Simon

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

* [U-Boot] flashing and testing u-boot on chromebook_bob
       [not found]         ` <CAPnjgZ3nD9_O1sDKBQeUnTPwk=c6SCa1F0xJ_uipDQY+Wc8x6A@mail.gmail.com>
@ 2019-11-30  5:24           ` Sahaj Sarup
  2019-12-28  2:27             ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Sahaj Sarup @ 2019-11-30  5:24 UTC (permalink / raw)
  To: u-boot

Hi Simon,

Been a couple of weeks. I have obtained a SuzyQable and its working
well with bob. I can see RxTx from Cr50, AP and EC. On mainline linux
from ArchLinuxArm I can see earlyprintk as well. However I am still
stuck on the u-boot end.

Just to make sure I didn't miss anything, I'm laying down all the
steps that I followed to have u-boot chainloaded from depthcharge on
bob.

1. Build U-boot
- Build bl31 as in README.rockchip. export bl31.elf as BL31 env
- change CONFIG_SYS_TEXT_BASE to 0x20000100
    - 0x20000000 From
https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/master/board/bob/defconfig#11
    - 0x100 padding for fit image.
- make chromebook_bob_defconfig
- make

2. Create Fit Image (some hints taken from
https://wiki.debian.org/InstallingDebianOn/Asus/C101PA)
- Using the following .its
```
/dts-v1/;

/ {
    description = "U-Boot + FDT -------- THIS PADDING IS NEEDED SO THE
IMAGE STARTS AT THE RIGHT OFFSET";
    #address-cells = <1>;

    images {

        kernel at 1 {
            description = "kernel";
            data = /incbin/("../../u-boot.bin");
            type = "kernel_noload";
            os = "linux";
            arch = "arm64";
            compression = "none";
            load = <0>;
            entry = <0>;
        };
        fdt at 1 {
            description = "rk3399-gru-bob.dtb";
            data = /incbin/("../../arch/arm/dts/rk3399-gru-bob.dtb");
            type = "flat_dt";
            arch = "arm64";
            compression = "none";
            hash at 1 {
                                algo = "sha1";
                        };
        };

    };
    configurations {
        default = "conf at 1";
        conf at 1 {
            kernel = "kernel at 1";
            fdt = "fdt at 1";
        };

    };

};
```

- mkimage -D "-I dts -O dtb -p 2048" -f
doc/chromium/chromebook_bob.its ./u-boot-chromium.fit

- Made sure that the offset is 0x100

```
[sahaj at fedora-work u-boot]$ hexdump u-boot.bin | head
0000000 000a 1400 201f d503 0100 2000 0000 0000

[sahaj at fedora-work u-boot]$ hexdump u-boot-chromium.fit | head -20
<truncated>
00000e0 0000 0300 0000 0700 0000 0000 656b 6e72
00000f0 6c65 0000 0000 0300 0b00 842c 0000 1b00
0000100 000a 1400 201f d503 0100 2000 0000 0000
0000110 33f8 000a 0000 0000 33f8 000a 0000 0000
0000120 0a18 000c 0000 0000 003c 1400 76a0 1000
0000130 4241 d538 303f f100 00a0 5400 203f f100
[sahaj at fedora-work u-boot]$
```

- Created bootloader offset: dd if=/dev/zero of=bootloader.bin bs=512 count=1

- Build image: vbutil_kernel --pack u-boot.kpart --version 1 --vmlinuz
u-boot-chromium.fit --arch aarch64 --keyblock
doc/chromium/devkeys/kernel.keyblock --signprivate
doc/chromium/devkeys/kernel_data_key.vbprivk --config dummy.txt
--bootloader bootloader.bin


3. Flash and boot:

- SDCard kernel part: cgpt add -i 1 -t kernel -b 8192 -s 65536 -l
Kernel -S 1 -T 5 -P 10 /dev/sda
- sudo dd if=u-boot.kpart of=/dev/sdd1
- On the dev mode screen select ctrl+u
- ttyUSB1 (AP COnsole) remains blank
- power led is solid
- keep power button pressed for 10 sec for poweroff



On Fri, 22 Nov 2019 at 03:53, Simon Glass <sjg@chromium.org> wrote:
>
> +U-Boot Mailing List
> Please do copy the mailing list on each message.
>
> On Wed, 20 Nov 2019 at 17:16, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> >
> >
> >
> > On Tue, Nov 19, 2019, 06:51 Simon Glass <sjg@chromium.org> wrote:
> >>
> >> Hi Sahaj,
> >>
> >> On Mon, 18 Nov 2019 at 00:09, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> >> >
> >> > see in-line...
> >> >
> >> > On Mon, 18 Nov 2019 at 11:16, Simon Glass <sjg@chromium.org> wrote:
> >> > >
> >> > > Hi Sahaj,
> >> > >
> >> > > On Sun, 17 Nov 2019 at 21:33, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> >> > > >
> >> > > > Hi All,
> >> > > >
> >> > > > I was wondering if you could answer a few questions regarding u-boot
> >> > > > on Asus CP101 gru/bob ?
> >> > > >
> >> > > > - To test the u-boot image following README.chromium-chainload,
> >> > > > should I expect output on the display or do I need
> >> > > > CDD/SuzyQable Cable for serial?
> >> > >
> >> > > The display should work OK. I don't think that device supports CCD.
> >> >
> >> > Well since the display is blank and the uboot.bin and uboot.fit have
> >> > a correct 0x100 offset, I'll need to wait for my CCD cable to arrive.
> >> > Bob in fact supports ccd:
> >> > https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
> >> > Although, i am confused as well since edp is supported, at least in
> >> > the dts files.
> >>
> >> Then I suspect it is broken.
> >
> >
> > Not broken, doesn't exist. The Edp driver is only for rk3288. I'm guessing they use the same ip, but soc specific stuff needs to be added for 3399.
> >
> > I was taking a look at rockchip's u-boot fork, looks like they are using drm for display now.
>
> OK I see,
>
> Regards,
> Simon



-- 
Best Regards
Sahaj Sarup

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

* flashing and testing u-boot on chromebook_bob
  2019-11-30  5:24           ` Sahaj Sarup
@ 2019-12-28  2:27             ` Simon Glass
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2019-12-28  2:27 UTC (permalink / raw)
  To: u-boot

Hi Sahaj,

On Fri, 29 Nov 2019 at 22:24, Sahaj Sarup <sahajsarup@gmail.com> wrote:
>
> Hi Simon,
>
> Been a couple of weeks. I have obtained a SuzyQable and its working
> well with bob. I can see RxTx from Cr50, AP and EC. On mainline linux
> from ArchLinuxArm I can see earlyprintk as well. However I am still
> stuck on the u-boot end.
>
> Just to make sure I didn't miss anything, I'm laying down all the
> steps that I followed to have u-boot chainloaded from depthcharge on
> bob.
>
> 1. Build U-boot
> - Build bl31 as in README.rockchip. export bl31.elf as BL31 env
> - change CONFIG_SYS_TEXT_BASE to 0x20000100
>     - 0x20000000 From
> https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/master/board/bob/defconfig#11
>     - 0x100 padding for fit image.

Well that needs to be checked. Unfortunately the Chromium vboot loader
things doesn't support FIT properly so you have to figure this out for
each board.

> - make chromebook_bob_defconfig
> - make

Note that this is designed to run bare metal. I am not sure if it
works with chain loading?

You might be able to get printch() to work for some early debugging?

>
> 2. Create Fit Image (some hints taken from
> https://wiki.debian.org/InstallingDebianOn/Asus/C101PA)
> - Using the following .its
> ```
> /dts-v1/;
>
> / {
>     description = "U-Boot + FDT -------- THIS PADDING IS NEEDED SO THE
> IMAGE STARTS AT THE RIGHT OFFSET";
>     #address-cells = <1>;
>
>     images {
>
>         kernel at 1 {
>             description = "kernel";
>             data = /incbin/("../../u-boot.bin");
>             type = "kernel_noload";
>             os = "linux";
>             arch = "arm64";
>             compression = "none";
>             load = <0>;
>             entry = <0>;
>         };
>         fdt at 1 {
>             description = "rk3399-gru-bob.dtb";
>             data = /incbin/("../../arch/arm/dts/rk3399-gru-bob.dtb");
>             type = "flat_dt";
>             arch = "arm64";
>             compression = "none";
>             hash at 1 {
>                                 algo = "sha1";
>                         };
>         };
>
>     };
>     configurations {
>         default = "conf at 1";
>         conf at 1 {
>             kernel = "kernel at 1";
>             fdt = "fdt at 1";
>         };
>
>     };
>
> };
> ```
>
> - mkimage -D "-I dts -O dtb -p 2048" -f
> doc/chromium/chromebook_bob.its ./u-boot-chromium.fit
>
> - Made sure that the offset is 0x100
>
> ```
> [sahaj at fedora-work u-boot]$ hexdump u-boot.bin | head
> 0000000 000a 1400 201f d503 0100 2000 0000 0000
>
> [sahaj at fedora-work u-boot]$ hexdump u-boot-chromium.fit | head -20
> <truncated>
> 00000e0 0000 0300 0000 0700 0000 0000 656b 6e72
> 00000f0 6c65 0000 0000 0300 0b00 842c 0000 1b00
> 0000100 000a 1400 201f d503 0100 2000 0000 0000
> 0000110 33f8 000a 0000 0000 33f8 000a 0000 0000
> 0000120 0a18 000c 0000 0000 003c 1400 76a0 1000
> 0000130 4241 d538 303f f100 00a0 5400 203f f100
> [sahaj at fedora-work u-boot]$
> ```
>
> - Created bootloader offset: dd if=/dev/zero of=bootloader.bin bs=512 count=1
>
> - Build image: vbutil_kernel --pack u-boot.kpart --version 1 --vmlinuz
> u-boot-chromium.fit --arch aarch64 --keyblock
> doc/chromium/devkeys/kernel.keyblock --signprivate
> doc/chromium/devkeys/kernel_data_key.vbprivk --config dummy.txt
> --bootloader bootloader.bin
>
>
> 3. Flash and boot:
>
> - SDCard kernel part: cgpt add -i 1 -t kernel -b 8192 -s 65536 -l
> Kernel -S 1 -T 5 -P 10 /dev/sda
> - sudo dd if=u-boot.kpart of=/dev/sdd1
> - On the dev mode screen select ctrl+u
> - ttyUSB1 (AP COnsole) remains blank
> - power led is solid
> - keep power button pressed for 10 sec for poweroff
>
>
>
> On Fri, 22 Nov 2019 at 03:53, Simon Glass <sjg@chromium.org> wrote:
> >
> > +U-Boot Mailing List
> > Please do copy the mailing list on each message.
> >
> > On Wed, 20 Nov 2019 at 17:16, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> > >
> > >
> > >
> > > On Tue, Nov 19, 2019, 06:51 Simon Glass <sjg@chromium.org> wrote:
> > >>
> > >> Hi Sahaj,
> > >>
> > >> On Mon, 18 Nov 2019 at 00:09, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> > >> >
> > >> > see in-line...
> > >> >
> > >> > On Mon, 18 Nov 2019 at 11:16, Simon Glass <sjg@chromium.org> wrote:
> > >> > >
> > >> > > Hi Sahaj,
> > >> > >
> > >> > > On Sun, 17 Nov 2019 at 21:33, Sahaj Sarup <sahajsarup@gmail.com> wrote:
> > >> > > >
> > >> > > > Hi All,
> > >> > > >
> > >> > > > I was wondering if you could answer a few questions regarding u-boot
> > >> > > > on Asus CP101 gru/bob ?
> > >> > > >
> > >> > > > - To test the u-boot image following README.chromium-chainload,
> > >> > > > should I expect output on the display or do I need
> > >> > > > CDD/SuzyQable Cable for serial?
> > >> > >
> > >> > > The display should work OK. I don't think that device supports CCD.
> > >> >
> > >> > Well since the display is blank and the uboot.bin and uboot.fit have
> > >> > a correct 0x100 offset, I'll need to wait for my CCD cable to arrive.
> > >> > Bob in fact supports ccd:
> > >> > https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
> > >> > Although, i am confused as well since edp is supported, at least in
> > >> > the dts files.
> > >>
> > >> Then I suspect it is broken.
> > >
> > >
> > > Not broken, doesn't exist. The Edp driver is only for rk3288. I'm guessing they use the same ip, but soc specific stuff needs to be added for 3399.
> > >
> > > I was taking a look at rockchip's u-boot fork, looks like they are using drm for display now.
> >
> > OK I see,
> >
> > Regards,
> > Simon
>
>
>
> --
> Best Regards
> Sahaj Sarup

Regards,
Simon

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

end of thread, other threads:[~2019-12-28  2:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-18  5:33 [U-Boot] flashing and testing u-boot on chromebook_bob Sahaj Sarup
2019-11-18  5:46 ` Simon Glass
     [not found]   ` <CAGW0CY6c35P=UPd68sG3nfxv6CDsLu3v4hds34gYair_3RU1cg@mail.gmail.com>
2019-11-19  1:21     ` Simon Glass
     [not found]       ` <CAGW0CY5WLBDyQJ60+68ZxJLuZRZSptjW+orrbxCb1XXovM4ZJw@mail.gmail.com>
     [not found]         ` <CAPnjgZ3nD9_O1sDKBQeUnTPwk=c6SCa1F0xJ_uipDQY+Wc8x6A@mail.gmail.com>
2019-11-30  5:24           ` Sahaj Sarup
2019-12-28  2:27             ` Simon Glass

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