diff options
author | Gabe Black <gabeblack@chromium.org> | 2011-08-02 23:00:03 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:22 -0700 |
commit | 792f7f6ae53a75ad559e0c5c7092b3078467ef98 (patch) | |
tree | aa4f53c6baa1cadd8994008f63450d036deb85b3 /lib | |
parent | f2dd80ae0a4e4f3b9b22e03a3ca1de91c95114aa (diff) |
Remove the device tree from one of the vboot support APIs.
This change removes the device tree from one of the vboot support APIs so
that they fit better with coreboot u-boot. Specifically this is
cros_gpio_fetch which is for getting GPIO values. Coreboot will read these and
provide the values through its coreboot tables. The device tree pointer is
global data so it doesn't need to be passed around as a parameter to be
accessible.
This change also removes the device tree from other interfaces in
cmd_vboot_twostop.c so the structure of the code is more consistent. This way
people can expect the device tree to always be the one pointed at by the
global data and not sometimes one and sometimes the other, even though as
written those will be equivalent. This change also takes the opportunity to
mark the local functions in that file static, which is most of them.
BUG=chrome-os-partner:4552
TEST=Built for x86-alex and tegra2_kaen. Installed and booted to chromeos
login on Kaen.
Change-Id: I084e774d97025d9ec71abe09c92fab8a7827892f
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: http://gerrit.chromium.org/gerrit/5232
Reviewed-by: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vbexport/misc.c | 7 | ||||
-rw-r--r-- | lib/vboot/global_data.c | 9 |
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/vbexport/misc.c b/lib/vbexport/misc.c index cab7a4c449d..9a608aba4b4 100644 --- a/lib/vbexport/misc.c +++ b/lib/vbexport/misc.c @@ -15,15 +15,12 @@ #define PREFIX "misc: " -DECLARE_GLOBAL_DATA_PTR; - uint32_t VbExIsShutdownRequested(void) { - void *fdt_ptr = (void *)gd->blob; cros_gpio_t lidsw, pwrsw; - if (cros_gpio_fetch(CROS_GPIO_LIDSW, fdt_ptr, &lidsw) || - cros_gpio_fetch(CROS_GPIO_PWRSW, fdt_ptr, &pwrsw)) { + if (cros_gpio_fetch(CROS_GPIO_LIDSW, &lidsw) || + cros_gpio_fetch(CROS_GPIO_PWRSW, &pwrsw)) { VBDEBUG(PREFIX "Failed to fetch GPIO!\n"); /* still return 0, No-Shutdown-Requested */ return 0; diff --git a/lib/vboot/global_data.c b/lib/vboot/global_data.c index 0070d3fe182..1442096dafd 100644 --- a/lib/vboot/global_data.c +++ b/lib/vboot/global_data.c @@ -29,7 +29,6 @@ vb_global_t *get_vboot_global(void) int init_vboot_global(vb_global_t *global, firmware_storage_t *file) { - void *fdt_ptr = (void *)gd->blob; cros_gpio_t wpsw, recsw, devsw; struct twostop_fmap fmap; uint8_t frid[ID_LEN]; @@ -41,14 +40,14 @@ int init_vboot_global(vb_global_t *global, firmware_storage_t *file) VBGLOBAL_SIGNATURE_SIZE); /* Gets GPIO status */ - if (cros_gpio_fetch(CROS_GPIO_WPSW, fdt_ptr, &wpsw) || - cros_gpio_fetch(CROS_GPIO_RECSW, fdt_ptr, &recsw) || - cros_gpio_fetch(CROS_GPIO_DEVSW, fdt_ptr, &devsw)) { + if (cros_gpio_fetch(CROS_GPIO_WPSW, &wpsw) || + cros_gpio_fetch(CROS_GPIO_RECSW, &recsw) || + cros_gpio_fetch(CROS_GPIO_DEVSW, &devsw)) { VBDEBUG(PREFIX "Failed to fetch GPIO!\n"); return 1; } - if (fdt_decode_twostop_fmap(fdt_ptr, &fmap)) { + if (fdt_decode_twostop_fmap(gd->blob, &fmap)) { VBDEBUG(PREFIX "Failed to load fmap config from fdt!\n"); return 1; } |