summaryrefslogtreecommitdiff
path: root/lib/utils/reset/fdt_reset_gpio.c
AgeCommit message (Collapse)AuthorFilesLines
2022-05-30lib: utils/fdt: Require match data to be constSamuel Holland1-2/+2
Match data stores hardware attributes which do not change at runtime, so it does not need to be mutable. Make it const. Reviewed-by: Guo Ren <guoren@kernel.org> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Samuel Holland <samuel@sholland.org>
2021-11-12lib: utils/reset: add priority to gpio resetNikita Shubin1-2/+8
Make gpio_system_reset_check return priority instead of just true/false. Make default 128 priority for reset/shutdown. Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Tested-by: Alexandre Ghiti <alexandre.ghiti@canonical.com> Signed-off-by: Nikita Shubin <n.shubin@yadro.com>
2021-11-02lib: utils/reset: Register separate GPIO system reset devicesAnup Patel1-19/+41
Now that sbi_system support multiple system reset devices, we should register separate devices for GPIO restart and GPIO poweroff because DT describes these as separate devices with different compatible strings. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Dong Du <Dd_nirvana@sjtu.edu.cn>
2021-10-11lib: sbi: convert reset to listNikita Shubin1-1/+1
To support different handlers for different types of resets, we are adding a sbi_list of restart handlers. Instead of sbi_system_reset_set_device we use sbi_system_reset_add_device to reflect the actual meaning. Signed-off-by: Nikita Shubin <n.shubin@yadro.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-10-01lib: utils: identify supported GPIO reset methodsHeinrich Schuchardt1-23/+21
The GPIO reset driver supports reset and poweroff. But not all boards support both. gpio_system_reset_check() must detect this situation. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-09-26lib: utils/reset: use sbi_timer_mdelay() in gpio reset driverAnup Patel1-10/+3
We should use sbi_timer_mdelay() instead of custom gpio_mdelay() in the gpio reset driver. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Xiang W <wxjstz@126.com>
2021-07-27lib: utils: support both of gpio-poweroff, gpio-resetHeinrich Schuchardt1-1/+10
The generic GPIO reset driver has two entries in the match table: "gpio-poweroff", "gpio-reset". Only the first entry is considered by fdt_reset_init(). Define "gpio-poweroff" and "gpio-reset" as compatibility strings of two separate reset drivers. They still can share code. Fixes: e3d6919d10d7 ("lib: utils/reset: Add generic GPIO reset driver") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2021-07-17lib: utils/reset: Add generic GPIO reset driverGreen Wan1-0/+141
We add generic GPIO reset driver inspired from gpio-restart and gpio-poweroff drivers of Linux kernel. Signed-off-by: Green Wan <green.wan@sifive.com> Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>