Jonas Schwöbel | f6fb6b2 | 2022-04-02 22:04:00 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * Copyright (c) 2010-2012, NVIDIA CORPORATION. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | #ifndef __CONFIG_H |
| 7 | #define __CONFIG_H |
| 8 | |
| 9 | #include "tegra30-common.h" |
| 10 | |
| 11 | /* High-level configuration options */ |
| 12 | #define CFG_TEGRA_BOARD_STRING "Lenovo Ideapad Yoga 11" |
| 13 | |
| 14 | #define IDEAPAD_FLASH_UBOOT \ |
| 15 | "flash_uboot=sf probe 0:1;" \ |
| 16 | "echo Dumping current SPI flash content ...;" \ |
| 17 | "sf read ${kernel_addr_r} 0x0 ${spi_size};" \ |
| 18 | "if fatwrite mmc 1:1 ${kernel_addr_r} spi-flash-backup.bin ${spi_size};" \ |
| 19 | "then echo SPI flash content was successfully written into spi-flash-backup.bin;" \ |
| 20 | "echo Reading SPI flash binary;" \ |
| 21 | "if load mmc 1:1 ${kernel_addr_r} repart-block.bin;" \ |
| 22 | "then echo Writing bootloader into SPI flash;" \ |
| 23 | "sf probe 0:1;" \ |
| 24 | "sf update ${kernel_addr_r} 0x0 ${spi_size};" \ |
| 25 | "echo Bootloader SUCCESSFULLY written into SPI flash;" \ |
| 26 | "pause 'Press ANY key to reboot...'; reset;" \ |
| 27 | "else echo Preparing RAM;" \ |
| 28 | "mw ${kernel_addr_r} 0 ${boot_block_size_r};" \ |
| 29 | "mw ${ramdisk_addr_r} 0 ${boot_block_size_r};" \ |
| 30 | "echo Reading BCT;" \ |
| 31 | "sf read ${kernel_addr_r} 0x0 ${boot_block_size_r};" \ |
| 32 | "echo Reading bootloader;" \ |
| 33 | "if load mmc 1:1 ${ramdisk_addr_r} ${bootloader_file};" \ |
| 34 | "then echo Calculating bootloader size;" \ |
| 35 | "size mmc 1:1 ${bootloader_file};" \ |
| 36 | "ebtupdate ${kernel_addr_r} ${ramdisk_addr_r} ${filesize};" \ |
| 37 | "echo Writing bootloader into SPI flash;" \ |
| 38 | "sf probe 0:1;" \ |
| 39 | "sf update ${kernel_addr_r} 0x0 ${boot_block_size_r};" \ |
| 40 | "sf update ${ramdisk_addr_r} ${boot_block_size_r} ${boot_block_size_r};" \ |
| 41 | "echo Bootloader written SUCCESSFULLY;" \ |
| 42 | "pause 'Press ANY key to reboot...'; reset;" \ |
| 43 | "else echo Reading bootloader failed;" \ |
| 44 | "pause 'Press ANY key to reboot...'; reset; fi;" \ |
| 45 | "fi;" \ |
| 46 | "else echo SPI flash backup FAILED! Aborting ...;" \ |
| 47 | "pause 'Press ANY key to reboot...'; reset; fi\0" |
| 48 | |
| 49 | #define IDEAPAD_BOOTMENU \ |
| 50 | IDEAPAD_FLASH_UBOOT \ |
| 51 | "bootmenu_0=mount internal storage=usb start && ums 0 mmc 0; bootmenu\0" \ |
| 52 | "bootmenu_1=mount external storage=usb start && ums 0 mmc 1; bootmenu\0" \ |
| 53 | "bootmenu_2=fastboot=echo Starting Fastboot protocol ...; fastboot usb 0; bootmenu\0" \ |
| 54 | "bootmenu_3=update bootloader=run flash_uboot\0" \ |
| 55 | "bootmenu_4=reboot RCM=enterrcm\0" \ |
| 56 | "bootmenu_5=reboot=reset\0" \ |
| 57 | "bootmenu_6=power off=poweroff\0" \ |
| 58 | "bootmenu_delay=-1\0" |
| 59 | |
| 60 | #define BOARD_EXTRA_ENV_SETTINGS \ |
| 61 | "spi_size=0x400000\0" \ |
| 62 | "boot_block_size_r=0x200000\0" \ |
| 63 | "boot_block_size=0x1000\0" \ |
| 64 | "bootloader_file=u-boot-dtb-tegra.bin\0" \ |
| 65 | "button_cmd_0_name=Volume Down\0" \ |
| 66 | "button_cmd_0=bootmenu\0" \ |
| 67 | "button_cmd_1_name=Lid sensor\0" \ |
| 68 | "button_cmd_1=poweroff\0" \ |
| 69 | "partitions=name=emmc,start=0,size=-,uuid=${uuid_gpt_rootfs}\0" \ |
| 70 | IDEAPAD_BOOTMENU |
| 71 | |
| 72 | /* Board-specific serial config */ |
| 73 | #define CFG_SYS_NS16550_COM1 NV_PA_APB_UARTA_BASE |
| 74 | |
| 75 | #include "tegra-common-post.h" |
| 76 | |
| 77 | #endif /* __CONFIG_H */ |