mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
am335x, guardian: update swi logic
read boot mode gpio and set the swi status Signed-off-by: Gireesh Hiremath <Gireesh.Hiremath@in.bosch.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Link: https://lore.kernel.org/r/20210611161350.2141-12-Gireesh.Hiremath@in.bosch.com
This commit is contained in:
parent
da09ba6f73
commit
d364926da3
@ -15,6 +15,7 @@
|
|||||||
#include <i2c.h>
|
#include <i2c.h>
|
||||||
#include <led.h>
|
#include <led.h>
|
||||||
#include <panel.h>
|
#include <panel.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
#include <asm/global_data.h>
|
#include <asm/global_data.h>
|
||||||
#include <power/tps65217.h>
|
#include <power/tps65217.h>
|
||||||
#include <spl.h>
|
#include <spl.h>
|
||||||
@ -205,8 +206,19 @@ static void set_bootmode_env(void)
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
value = dm_gpio_get_value(&boot_mode_desc);
|
dm_gpio_set_dir_flags(&boot_mode_desc, GPIOD_IS_IN);
|
||||||
value ? env_set("swi_status", "0") : env_set("swi_status", "1");
|
udelay(10);
|
||||||
|
|
||||||
|
ret = dm_gpio_get_value(&boot_mode_desc);
|
||||||
|
if (ret == 0) {
|
||||||
|
env_set("swi_status", "1");
|
||||||
|
} else if (ret == 1) {
|
||||||
|
env_set("swi_status", "0");
|
||||||
|
} else {
|
||||||
|
printf("swi status gpio error\n");
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
@ -64,13 +64,13 @@
|
|||||||
"setenv rootflags \"bulk_read,chk_data_crc\"; " \
|
"setenv rootflags \"bulk_read,chk_data_crc\"; " \
|
||||||
"setenv ethact usb_ether; " \
|
"setenv ethact usb_ether; " \
|
||||||
"if test \"${swi_status}\" -eq 1; then " \
|
"if test \"${swi_status}\" -eq 1; then " \
|
||||||
"setenv extrabootargs \"swi_attached\"; " \
|
|
||||||
"if dhcp; then " \
|
"if dhcp; then " \
|
||||||
"sleep 1; " \
|
"sleep 1; " \
|
||||||
"if tftp \"${tftp_load_addr}\" \"bootscript.scr\"; then " \
|
"if tftp \"${tftp_load_addr}\" \"bootscript.scr\"; then " \
|
||||||
"source \"${tftp_load_addr}\"; " \
|
"source \"${tftp_load_addr}\"; " \
|
||||||
"fi; " \
|
"fi; " \
|
||||||
"fi; " \
|
"fi; " \
|
||||||
|
"setenv extrabootargs $extrabootargs \"swi_attached\"; " \
|
||||||
"fi;" \
|
"fi;" \
|
||||||
"run bootcmd_ubifs0;\0" \
|
"run bootcmd_ubifs0;\0" \
|
||||||
"altbootcmd=" \
|
"altbootcmd=" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user