Tested-by: Niek Linnenbank <nieklinnenb...@gmail.com>
Reviewed-by: Niek Linnenbank <nieklinnenb...@gmail.com>

On Fri, Oct 23, 2020 at 3:18 PM Philippe Mathieu-Daudé <f4...@amsat.org>
wrote:

> This reverts commit b638627c723a8d0d2bb73489bc6bf9ff09b8d53a.
>
> Currently booting U-Boot on the Orange Pi PC we get:
>
>   console: U-Boot SPL 2020.04-armbian (Sep 02 2020 - 10:16:13 +0200)
>   ...
>   console: Autoboot in 1 seconds, press <Space> to stop
>   console: =>
>   console: => setenv extraargs 'printk.time=0 console=ttyS0,115200
> loglevel=7 nosmp systemd.default_timeout_start_sec=9000
> systemd.mask=armbian-zram-config.service
> systemd.mask=armbian-ramlog.service'
>   console: => boot
>   console: unable to select a mode
>   console: Device 0: unknown device
>   console: BOOTP broadcast 1
>   console: DHCP client bound to address 10.0.2.15 (12 ms)
>   console: *** Warning: no boot file name; using '0A00020F.img'
>   console: Using ethernet@1c30000 device
>   console: TFTP from server 10.0.2.2; our IP address is 10.0.2.15
>   console: Filename '0A00020F.img'.
>   console: Load address: 0x42000000
>   console: Loading: *
>   console: TFTP error: 'Access violation' (2)
>   console: Not retrying...
>   console: missing environment variable: pxeuuid
>   console: missing environment variable: bootfile
>   ...
>
> With commit b638627c723 reverted:
>
>   console: U-Boot SPL 2020.04-armbian (Sep 02 2020 - 10:16:13 +0200)
>   ...
>   console: Autoboot in 1 seconds, press <Space> to stop
>   console: =>
>   console: => setenv extraargs 'printk.time=0 console=ttyS0,115200
> loglevel=7 nosmp systemd.default_timeout_start_sec=9000
> systemd.mask=armbian-zram-config.service
> systemd.mask=armbian-ramlog.service'
>   console: => boot
>   console: switch to partitions #0, OK
>   console: mmc0 is current device
>   console: Scanning mmc 0:1...
>   console: Found U-Boot script /boot/boot.scr
>   console: 3967 bytes read in 16 ms (241.2 KiB/s)
>   console: ## Executing script at 43100000
>   console: U-boot loaded from SD
>   console: Boot script loaded from mmc
>   console: 153 bytes read in 10 ms (14.6 KiB/s)
>   console: 11185760 bytes read in 6698 ms (1.6 MiB/s)
>   console: 7788240 bytes read in 2966 ms (2.5 MiB/s)
>   console: Found mainline kernel configuration
>   console: 32121 bytes read in 50 ms (627 KiB/s)
>   console: 4185 bytes read in 23 ms (176.8 KiB/s)
>   console: Applying kernel provided DT fixup script (sun8i-h3-fixup.scr)
>   console: ## Executing script at 45000000
>   console: ## Loading init Ramdisk from Legacy Image at 43300000 ...
>   console: Image Name:   uInitrd
>   console: Image Type:   ARM Linux RAMDisk Image (gzip compressed)
>   console: Data Size:    11185696 Bytes = 10.7 MiB
>   console: Load Address: 00000000
>   console: Entry Point:  00000000
>   console: Verifying Checksum ... OK
>   console: ## Flattened Device Tree blob at 43000000
>   console: Booting using the fdt blob at 0x43000000
>   console: Loading Ramdisk to 49555000, end 49fffe20 ... OK
>   console: Loading Device Tree to 494e4000, end 49554fff ... OK
>   console: Starting kernel ...
>   console: Uncompressing Linux... done, booting the kernel.
>
> Fixes: b638627c723 ("hw/sd: Fix incorrect populated function switch status
> data structure")
> Reported-by: Michael Roth <mdr...@linux.vnet.ibm.com>
> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
> ---
>  hw/sd/sd.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index c3febed2434..c17197785bc 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -823,12 +823,11 @@ static void sd_function_switch(SDState *sd, uint32_t
> arg)
>      sd->data[11] = 0x43;
>      sd->data[12] = 0x80;       /* Supported group 1 functions */
>      sd->data[13] = 0x03;
> -
>      for (i = 0; i < 6; i ++) {
>          new_func = (arg >> (i * 4)) & 0x0f;
>          if (mode && new_func != 0x0f)
>              sd->function_group[i] = new_func;
> -        sd->data[16 - (i >> 1)] |= new_func << ((i % 2) * 4);
> +        sd->data[14 + (i >> 1)] = new_func << ((i * 4) & 4);
>      }
>      memset(&sd->data[17], 0, 47);
>      stw_be_p(sd->data + 64, sd_crc16(sd->data, 64));
> --
> 2.26.2
>
>

-- 
Niek Linnenbank

Reply via email to