1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Configuration for the SEI510
5 * Copyright (C) 2019 Baylibre, SAS
6 * Author: Jerome Brunet <jbrunet@baylibre.com>
12 #define CONFIG_SYS_MMC_ENV_DEV 2
13 #define CONFIG_SYS_MMC_ENV_PART 1
14 #define CONFIG_ENV_SIZE 0x10000
15 #define CONFIG_ENV_OFFSET (-0x10000)
17 #define CACHE_UUID "99207ae6-5207-11e9-999e-6f77a3612069;"
18 #define SYSTEM_UUID "99f9b7ac-5207-11e9-8507-c3c037e393f3;"
19 #define VENDOR_UUID "9d082802-5207-11e9-954c-cbbce08ba108;"
20 #define USERDATA_UUID "9b976e42-5207-11e9-8f16-ff47ac594b22;"
21 #define ROOT_UUID "ddb8c3f6-d94d-4394-b633-3134139cc2e0;"
23 #define PARTS_DEFAULT \
24 "uuid_disk=${uuid_gpt_disk};" \
25 "name=boot,size=64M,bootable,uuid=${uuid_gpt_boot};" \
26 "name=cache,size=256M,uuid=" CACHE_UUID \
27 "name=system,size=1536M,uuid=" SYSTEM_UUID \
28 "name=vendor,size=256M,uuid=" VENDOR_UUID \
29 "name=userdata,size=4746M,uuid=" USERDATA_UUID \
30 "name=rootfs,size=-,uuid=" ROOT_UUID
32 #define BOOTENV_DEV_FASTBOOT(devtypeu, devtypel, instance) \
34 "sm reboot_reason reason;" \
35 "setenv run_fastboot 0;" \
36 "if gpt verify mmc ${mmcdev} ${partitions}; then; " \
38 "echo Broken MMC partition scheme;" \
39 "setenv run_fastboot 1;" \
41 "if test \"${reason}\" = \"bootloader\" -o " \
42 "\"${reason}\" = \"fastboot\"; then " \
43 "echo Fastboot asked by reboot reason;" \
44 "setenv run_fastboot 1;" \
46 "if test \"${skip_fastboot}\" -eq 1; then " \
47 "echo Fastboot skipped by environment;" \
48 "setenv run_fastboot 0;" \
50 "if test \"${force_fastboot}\" -eq 1; then " \
51 "echo Fastboot forced by environment;" \
52 "setenv run_fastboot 1;" \
54 "if test \"${run_fastboot}\" -eq 1; then " \
55 "echo Running Fastboot...;" \
59 #define BOOTENV_DEV_NAME_FASTBOOT(devtypeu, devtypel, instance) \
62 /* TOFIX: Run actual recovery instead of fastboot */
63 #define BOOTENV_DEV_RECOVERY(devtypeu, devtypel, instance) \
65 "pinmux dev pinctrl@14;" \
66 "pinmux dev pinctrl@40;" \
67 "sm reboot_reason reason;" \
68 "setenv run_recovery 0;" \
69 "if run check_button; then " \
70 "echo Recovery button is pressed;" \
71 "setenv run_recovery 1;" \
72 "elif test \"${reason}\" = \"recovery\" -o " \
73 "\"${reason}\" = \"update\"; then " \
74 "echo Recovery asked by reboot reason;" \
75 "setenv run_recovery 1;" \
77 "if test \"${skip_recovery}\" -eq 1; then " \
78 "echo Recovery skipped by environment;" \
79 "setenv run_recovery 0;" \
81 "if test \"${force_recovery}\" -eq 1; then " \
82 "echo Recovery forced by environment;" \
83 "setenv run_recovery 1;" \
85 "if test \"${run_recovery}\" -eq 1; then " \
86 "echo Running Recovery...;" \
90 #define BOOTENV_DEV_NAME_RECOVERY(devtypeu, devtypel, instance) \
93 #define BOOTENV_DEV_SYSTEM(devtypeu, devtypel, instance) \
95 "echo Loading Android boot partition...;" \
96 "mmc dev ${mmcdev};" \
97 "setenv bootargs ${bootargs} console=${console} androidboot.serialno=${serial#};" \
98 "part start mmc ${mmcdev} ${bootpart} boot_start;" \
99 "part size mmc ${mmcdev} ${bootpart} boot_size;" \
100 "if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
101 "echo Running Android...;" \
102 "bootm ${loadaddr};" \
104 "echo Failed to boot Android...;" \
107 #define BOOTENV_DEV_NAME_SYSTEM(devtypeu, devtypel, instance) \
110 #define BOOT_TARGET_DEVICES(func) \
111 func(ROMUSB, romusb, na) \
112 func(FASTBOOT, fastboot, na) \
113 func(RECOVERY, recovery, na) \
114 func(SYSTEM, system, na) \
116 #define CONFIG_EXTRA_ENV_SETTINGS \
117 "partitions=" PARTS_DEFAULT "\0" \
120 "gpio_recovery=88\0" \
121 "check_button=gpio input ${gpio_recovery};test $? -eq 0;\0" \
122 "console=/dev/ttyAML0\0" \
123 "bootargs=no_console_suspend\0" \
124 "stdin=" STDIN_CFG "\0" \
125 "stdout=" STDOUT_CFG "\0" \
126 "stderr=" STDOUT_CFG "\0" \
127 "loadaddr=0x01000000\0" \
128 "fdt_addr_r=0x01000000\0" \
129 "scriptaddr=0x08000000\0" \
130 "kernel_addr_r=0x01080000\0" \
131 "pxefile_addr_r=0x01080000\0" \
132 "ramdisk_addr_r=0x13000000\0" \
133 "fdtfile=amlogic/" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" BOOTENV
135 #include <configs/meson64.h>
137 #endif /* __CONFIG_H */