configs: meson64_android: don't set console bootargs
[platform/kernel/u-boot.git] / include / configs / meson64_android.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Configuration for Android Amlogic Meson 64bits SoCs
4  *
5  * Copyright (C) 2019 Baylibre, SAS
6  * Author: Jerome Brunet <jbrunet@baylibre.com>
7  */
8
9 #ifndef __MESON64_ANDROID_CONFIG_H
10 #define __MESON64_ANDROID_CONFIG_H
11
12 #ifndef BOOT_PARTITION
13 #define BOOT_PARTITION "boot"
14 #endif
15
16 #ifndef LOGO_PARTITION
17 #define LOGO_PARTITION "logo"
18 #endif
19
20 #define BOOTENV_DEV_FASTBOOT(devtypeu, devtypel, instance) \
21         "bootcmd_fastboot=" \
22                 "sm reboot_reason reason;" \
23                 "setenv run_fastboot 0;" \
24                 "if test \"${boot_source}\" = \"usb\"; then " \
25                         "echo Fastboot forced by usb rom boot;" \
26                         "setenv run_fastboot 1;" \
27                 "fi;" \
28                 "if gpt verify mmc ${mmcdev} ${partitions}; then; " \
29                 "else " \
30                         "echo Broken MMC partition scheme;" \
31                         "setenv run_fastboot 1;" \
32                 "fi;" \
33                 "if test \"${reason}\" = \"bootloader\" -o " \
34                         "\"${reason}\" = \"fastboot\"; then " \
35                         "echo Fastboot asked by reboot reason;" \
36                         "setenv run_fastboot 1;" \
37                 "fi;" \
38                 "if test \"${skip_fastboot}\" -eq 1; then " \
39                         "echo Fastboot skipped by environment;" \
40                         "setenv run_fastboot 0;" \
41                 "fi;" \
42                 "if test \"${force_fastboot}\" -eq 1; then " \
43                         "echo Fastboot forced by environment;" \
44                         "setenv run_fastboot 1;" \
45                 "fi;" \
46                 "if test \"${run_fastboot}\" -eq 1; then " \
47                         "echo Running Fastboot...;" \
48                         "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
49                 "fi\0"
50
51 #define BOOTENV_DEV_NAME_FASTBOOT(devtypeu, devtypel, instance) \
52                 "fastboot "
53
54 /* TOFIX: Run actual recovery instead of fastboot */
55 #define BOOTENV_DEV_RECOVERY(devtypeu, devtypel, instance) \
56         "bootcmd_recovery=" \
57                 "pinmux dev pinctrl@14;" \
58                 "pinmux dev pinctrl@40;" \
59                 "sm reboot_reason reason;" \
60                 "setenv run_recovery 0;" \
61                 "if run check_button; then " \
62                         "echo Recovery button is pressed;" \
63                         "setenv run_recovery 1;" \
64                 "elif test \"${reason}\" = \"recovery\" -o " \
65                           "\"${reason}\" = \"update\"; then " \
66                         "echo Recovery asked by reboot reason;" \
67                         "setenv run_recovery 1;" \
68                 "fi;" \
69                 "if test \"${skip_recovery}\" -eq 1; then " \
70                         "echo Recovery skipped by environment;" \
71                         "setenv run_recovery 0;" \
72                 "fi;" \
73                 "if test \"${force_recovery}\" -eq 1; then " \
74                         "echo Recovery forced by environment;" \
75                         "setenv run_recovery 1;" \
76                 "fi;" \
77                 "if test \"${run_recovery}\" -eq 1; then " \
78                         "echo Running Recovery...;" \
79                         "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \
80                 "fi\0"
81
82 #define BOOTENV_DEV_NAME_RECOVERY(devtypeu, devtypel, instance) \
83                 "recovery "
84
85 #define BOOTENV_DEV_SYSTEM(devtypeu, devtypel, instance) \
86         "bootcmd_system=" \
87                 "echo Loading Android " BOOT_PARTITION " partition...;" \
88                 "mmc dev ${mmcdev};" \
89                 "setenv bootargs ${bootargs} androidboot.serialno=${serial#};" \
90                 "part start mmc ${mmcdev} " BOOT_PARTITION " boot_start;" \
91                 "part size mmc ${mmcdev} " BOOT_PARTITION " boot_size;" \
92                 "if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
93                         "echo Running Android...;" \
94                         "bootm ${loadaddr};" \
95                 "fi;" \
96                 "echo Failed to boot Android...;" \
97                 "reset\0"
98
99 #define BOOTENV_DEV_NAME_SYSTEM(devtypeu, devtypel, instance)   \
100                 "system "
101
102 #define BOOT_TARGET_DEVICES(func) \
103         func(FASTBOOT, fastboot, na) \
104         func(RECOVERY, recovery, na) \
105         func(SYSTEM, system, na) \
106
107 #define PREBOOT_LOAD_LOGO \
108         "if test \"${boot_source}\" != \"usb\" && " \
109                 "gpt verify mmc ${mmcdev} ${partitions}; then; " \
110                 "mmc dev ${mmcdev};" \
111                 "part start mmc ${mmcdev} " LOGO_PARTITION " boot_start;" \
112                 "part size mmc ${mmcdev} " LOGO_PARTITION " boot_size;" \
113                 "if mmc read ${loadaddr} ${boot_start} ${boot_size}; then " \
114                         "bmp display ${loadaddr} m m;" \
115                 "fi;" \
116         "fi;"
117
118 #define CONFIG_EXTRA_ENV_SETTINGS                                     \
119         "partitions=" PARTS_DEFAULT "\0"                              \
120         "mmcdev=2\0"                                                  \
121         "gpio_recovery=88\0"                                          \
122         "check_button=gpio input ${gpio_recovery};test $? -eq 0;\0"   \
123         "load_logo=" PREBOOT_LOAD_LOGO "\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"        \
134         BOOTENV
135
136 #include <configs/meson64.h>
137
138 #endif /* __MESON64_ANDROID_CONFIG_H */