[U-Boot] [RFC] sandbox: Enable 1:1 map

Simon Glass sjg at chromium.org
Thu Jun 21 02:55:39 UTC 2018


Hi Heinrich,

On 20 June 2018 at 20:01, Simon Glass <sjg at chromium.org> wrote:
> Hi Heinrich,
>
> On 20 June 2018 at 19:23, Heinrich Schuchardt <xypron.glpk at gmx.de> wrote:
>> On 06/20/2018 07:51 PM, Simon Glass wrote:
>>> Hi Alex,
>>>
>>> On 14 June 2018 at 17:13, Alexander Graf <agraf at suse.de> wrote:
>>>> So far we've always had a split address space situation with
>>>> "U-Boot addresses" (a number space starting from 0) and "host
>>>> virtual addresses" (128MB mapped randomly in address space).
>>>>
>>>> This meant that we had to make sure all code is properly aware that
>>>> addresses and pointers are not the same thing, so they must not cast
>>>> between the two.
>>>>
>>>> However, most real boards do actually have a 1:1 map. So it's
>>>> much easier to just expose the same in sandbox.
>>>>
>>>> So this patch maps sandbox RAM from 0x8000000-0x10000000. This
>>>> address range fits just fine on both 32bit and 64bit systems.
>>>>
>>>> ---
>>>>
>>>> The patch is on top of my "efi-sandbox-v3" tree. But I'm sure
>>>> it easily applies on vanilla too.
>>>>
>>>> I also don't know if this really is the best path forward, but
>>>> at least it's one that gets rid of the one awkward target that
>>>> does not have a 1:1 map ;)
>>>> ---
>>>>  arch/sandbox/cpu/cpu.c             | 18 ++----------------
>>>>  arch/sandbox/cpu/state.c           |  4 ++--
>>>>  arch/sandbox/cpu/u-boot.lds        |  3 +++
>>>>  arch/sandbox/include/asm/io.h      | 17 +++++------------
>>>>  common/board_f.c                   |  4 +++-
>>>>  configs/sandbox64_defconfig        |  6 +++---
>>>>  configs/sandbox_defconfig          |  6 +++---
>>>>  configs/sandbox_flattree_defconfig |  4 ++--
>>>>  configs/sandbox_noblk_defconfig    |  4 ++--
>>>>  configs/sandbox_spl_defconfig      |  4 ++--
>>>>  include/configs/sandbox.h          | 22 +++++++++++-----------
>>>>  11 files changed, 38 insertions(+), 54 deletions(-)
>>>
>>> NAK, as discussed.
>>>
>>> Just to repeat myself, I do not want to change how sandbox works at
>>> this stage. We will always have some need for mapping, even if only to
>>> make PCI work.
>>>
>>> Once we have EFI working and have more test coverage in U-Boot itself
>>> we can revisit this. But this change is not necessary to make EFI
>>> work.
>>
>> Hi Simon,
>>
>> unfortunately I have not seen that your patches make EFI work on the
>> sandbox. bootefi selftest always failed. Now you even explicitly exclude
>> all tests
>> (https://lists.denx.de/pipermail/u-boot/2018-June/332133.html). With
>> Alex patch series the existing tests work fine.
>>
>> I see no point in merging patches for the Sandbox which ignore the
>> existing tests.
>
> My original goal (with the series) was to enable basic EFI support in
> sandbox, enough to run the hello world app.
>
> That was (I think) a reasonable step forward. Future work could then
> have enabled selftest.
>
> But it seems that both you and Alex want everything done in one huge
> series, so that we go from no EFI support on sandbox, to enough
> support to run selftest. That is obviously more work, more complex,
> etc. But that is what I have done with the latest series.
>
> For me, selftest runs fine with my series. What error do you see?

You can test the tree at u-boot-dm/efi-working

This is what I get:

$ crosfw -b sandbox
$ /tmp/b/sandbox/u-boot -c "bootefi selftest"


U-Boot 2018.07-rc2-00030-ge3b8a5d (Jun 20 2018 - 20:54:15 -0600)

DRAM:  128 MiB
MMC:
In:    serial
Out:   serial
Err:   serial
SCSI:  Net:   No ethernet found.
IDE:   Bus 0: not available
Found 0 disks
WARNING: booting without device tree

Testing EFI API implementation

Number of tests to execute: 18

Setting up 'block device'
Setting up 'block device' succeeded

Executing 'block device'
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_block_device.c(378):
TODO: Wrong volume label 'xxa1', expected 'U-BOOT TEST'
map_to_sysmem: Added map from 00007fffc2de8190 to 8000000
phys_to_virt: Used map from 8000000 to 00007fffc2de8190
Executing 'block device' succeeded

Tearing down 'block device'
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_block_device.c(261):
TODO: Failed to uninstall block I/O protocol
Tearing down 'block device' succeeded

Setting up 'controllers'
Setting up 'controllers' succeeded

Executing 'controllers'
Executing 'controllers' succeeded

Setting up 'device path'
Setting up 'device path' succeeded

Executing 'device path'
Installed device path protocols:
/MemoryMapped(0x0,0x4684e9,0x4684e9)
/VenHw(dbca4c98-6cb0-694d-0872-819c650cb7b8)/HD(1,MBR,0xd1535d21,0x1,0x7f)
/VenHw(dbca4c98-6cb0-694d-0872-819c650cbbb1)
/VenHw(dbca4c98-6cb0-694d-0872-819c650cbbb1)/VenHw(dbca4c98-6cb0-694d-0872-819c650cbba2)
/VenHw(dbca4c98-6cb0-694d-0872-819c650cbbb1)/VenHw(dbca4c98-6cb0-694d-0872-819c650cbba2)/VenHw(dbca4c98-6cb0-694d-0872-819c650cbbc3)
Executing 'device path' succeeded

Tearing down 'device path'
Tearing down 'device path' succeeded

Setting up 'device path utilities protocol'
Setting up 'device path utilities protocol' succeeded

Executing 'device path utilities protocol'
Executing 'device path utilities protocol' succeeded

Setting up 'event groups'
Setting up 'event groups' succeeded

Executing 'event groups'
Executing 'event groups' succeeded

Setting up 'event services'
Setting up 'event services' succeeded

Executing 'event services'
Executing 'event services' succeeded

Tearing down 'event services'
Tearing down 'event services' succeeded

Setting up 'graphical output'
Graphical output protocol is not available.
Setting up 'graphical output' succeeded

Executing 'graphical output'
Executing 'graphical output' succeeded

Tearing down 'graphical output'
Tearing down 'graphical output' succeeded

Setting up 'manage protocols'
Setting up 'manage protocols' succeeded

Executing 'manage protocols'
Executing 'manage protocols' succeeded

Tearing down 'manage protocols'
Tearing down 'manage protocols' succeeded

Setting up 'simple network protocol'
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_snp.c(209):
ERROR: Failed to locate simple network protocol
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest.c(84):
ERROR: Setting up 'simple network protocol' failed

Tearing down 'simple network protocol'
Tearing down 'simple network protocol' succeeded

Executing 'text output'

Color palette
00000000000000000000000000000010000000000000002000000000000000300000000000000040000000000000005000000000000000600000000000000070
00000000000000010000000000000011000000000000002100000000000000310000000000000041000000000000005100000000000000610000000000000071
00000000000000020000000000000012000000000000002200000000000000320000000000000042000000000000005200000000000000620000000000000072
00000000000000030000000000000013000000000000002300000000000000330000000000000043000000000000005300000000000000630000000000000073
00000000000000040000000000000014000000000000002400000000000000340000000000000044000000000000005400000000000000640000000000000074
00000000000000050000000000000015000000000000002500000000000000350000000000000045000000000000005500000000000000650000000000000075
00000000000000060000000000000016000000000000002600000000000000360000000000000046000000000000005600000000000000660000000000000076
00000000000000070000000000000017000000000000002700000000000000370000000000000047000000000000005700000000000000670000000000000077
00000000000000080000000000000018000000000000002800000000000000380000000000000048000000000000005800000000000000680000000000000078
00000000000000090000000000000019000000000000002900000000000000390000000000000049000000000000005900000000000000690000000000000079
000000000000000a000000000000001a000000000000002a000000000000003a000000000000004a000000000000005a000000000000006a000000000000007a
000000000000000b000000000000001b000000000000002b000000000000003b000000000000004b000000000000005b000000000000006b000000000000007b
000000000000000c000000000000001c000000000000002c000000000000003c000000000000004c000000000000005c000000000000006c000000000000007c
000000000000000d000000000000001d000000000000002d000000000000003d000000000000004d000000000000005d000000000000006d000000000000007d
000000000000000e000000000000001e000000000000002e000000000000003e000000000000004e000000000000005e000000000000006e000000000000007e
000000000000000f000000000000001f000000000000002f000000000000003f000000000000004f000000000000005f000000000000006f000000000000007f
Testing cursor column update

ð‘€…ð‘€¢3
Executing 'text output' succeeded

Setting up 'task priority levels'
Setting up 'task priority levels' succeeded

Executing 'task priority levels'
Executing 'task priority levels' succeeded

Tearing down 'task priority levels'
Tearing down 'task priority levels' succeeded

Setting up 'variables'
Setting up 'variables' succeeded

Executing 'variables'
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_variables.c(62):
TODO: QueryVariableInfo failed
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_variables.c(133):
TODO: GetVariable returned wrong length 7
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_variables.c(135):
TODO: GetVariable returned wrong value
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_variables.c(146):
TODO: GetNextVariableName failed
/scratch/sglass/cosarm/src/third_party/u-boot/files/lib/efi_selftest/efi_selftest_variables.c(158):
TODO: GetNextVariableName did not return all variables
Executing 'variables' succeeded

Setting up 'watchdog timer'
Setting up 'watchdog timer' succeeded

Executing 'watchdog timer'
Executing 'watchdog timer' succeeded

Tearing down 'watchdog timer'
Tearing down 'watchdog timer' succeeded

Setting up 'ExitBootServices'
Setting up 'ExitBootServices' succeeded

Boot services terminated

Executing 'ExitBootServices'

Boot services terminated
Executing 'ExitBootServices' succeeded

Tearing down 'ExitBootServices'
Tearing down 'ExitBootServices' succeeded

Summary: 1 failures

Preparing for reset. Press any key...


Regards,
Simon


More information about the U-Boot mailing list