diff options
Diffstat (limited to 'arch/arm/mach-omap/omap_generic.c')
-rw-r--r-- | arch/arm/mach-omap/omap_generic.c | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/arch/arm/mach-omap/omap_generic.c b/arch/arm/mach-omap/omap_generic.c index a1c0aeb595..99e14fb540 100644 --- a/arch/arm/mach-omap/omap_generic.c +++ b/arch/arm/mach-omap/omap_generic.c @@ -22,14 +22,14 @@ #include <malloc.h> #include <libfile.h> #include <linux/stat.h> -#include <mach/gpmc.h> -#include <mach/generic.h> -#include <mach/am33xx-silicon.h> -#include <mach/omap3-silicon.h> -#include <mach/omap4-silicon.h> -#include <mach/am33xx-generic.h> -#include <mach/omap3-generic.h> -#include <mach/omap4-generic.h> +#include <mach/omap/gpmc.h> +#include <mach/omap/generic.h> +#include <mach/omap/am33xx-silicon.h> +#include <mach/omap/omap3-silicon.h> +#include <mach/omap/omap4-silicon.h> +#include <mach/omap/am33xx-generic.h> +#include <mach/omap/omap3-generic.h> +#include <mach/omap/omap4-generic.h> void __iomem *omap_gpmc_base; @@ -70,6 +70,24 @@ void __noreturn omap_start_barebox(void *barebox) hang(); } +#define OMAP_WDT_WWPS 0x34 +#define OMAP_WDT_WSPR 0x48 +#define WDT_DISABLE_CODE1 0xaaaa +#define WDT_DISABLE_CODE2 0x5555 + +void omap_watchdog_disable(const void __iomem *wdt) +{ + /* WDT is already running when the bootloader gets control + * Disable it to avoid "random" resets + */ + __raw_writel(WDT_DISABLE_CODE1, wdt + OMAP_WDT_WSPR); + + do { + } while (__raw_readl(wdt + OMAP_WDT_WWPS)); + + __raw_writel(WDT_DISABLE_CODE2, wdt + OMAP_WDT_WSPR); +} + #ifdef CONFIG_BOOTM static int do_bootm_omap_barebox(struct image_data *data) { @@ -95,6 +113,9 @@ static struct image_handler omap_barebox_handler = { static int omap_bootm_barebox(void) { + if (!cpu_is_omap()) + return 0; + return register_image_handler(&omap_barebox_handler); } device_initcall(omap_bootm_barebox); @@ -123,6 +144,9 @@ static int omap_env_init(void) struct cdev *cdev; const char *rootpath; + if (!cpu_is_omap()) + return 0; + if (bootsource_get() != BOOTSOURCE_MMC) return 0; @@ -156,6 +180,7 @@ static int omap_env_init(void) partname); default_environment_path_set(envpath); + free(envpath); out: free(partname); @@ -185,7 +210,7 @@ static int omap_init(void) if (root) { __omap_cpu_type = omap_soc_from_dt(); if (!__omap_cpu_type) - hang(); + return 0; } if (cpu_is_omap3()) |