diff options
-rw-r--r-- | board/daisy/board.c | 3 | ||||
-rw-r--r-- | board/mccroskey/board.c | 3 | ||||
-rw-r--r-- | board/snow/board.c | 3 | ||||
-rw-r--r-- | board/spring/board.c | 3 | ||||
-rw-r--r-- | chip/stm32/dma.c | 8 | ||||
-rw-r--r-- | include/dma.h (renamed from chip/stm32/dma.h) | 7 | ||||
-rw-r--r-- | include/hooks.h | 2 |
7 files changed, 8 insertions, 21 deletions
diff --git a/board/daisy/board.c b/board/daisy/board.c index f48faeb852..2f432d0842 100644 --- a/board/daisy/board.c +++ b/board/daisy/board.c @@ -5,7 +5,6 @@ /* Daisy board-specific configuration */ #include "common.h" -#include "dma.h" #include "extpower.h" #include "gaia_power.h" #include "gpio.h" @@ -139,8 +138,6 @@ int board_i2c_host_port(void) void configure_board(void) { - dma_init(); - /* Enable all GPIOs clocks * TODO: more fine-grained enabling for power saving */ diff --git a/board/mccroskey/board.c b/board/mccroskey/board.c index ba18740b24..22457fad3c 100644 --- a/board/mccroskey/board.c +++ b/board/mccroskey/board.c @@ -7,7 +7,6 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "dma.h" #include "gpio.h" #include "hooks.h" #include "i2c.h" @@ -102,8 +101,6 @@ void configure_board(void) { uint32_t val; - dma_init(); - /* Enable all GPIOs clocks * TODO: more fine-grained enabling for power saving */ diff --git a/board/snow/board.c b/board/snow/board.c index 3316ce87ce..7af5011e8a 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -7,7 +7,6 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "dma.h" #include "extpower.h" #include "gaia_power.h" #include "gpio.h" @@ -99,8 +98,6 @@ void configure_board(void) { uint32_t val; - dma_init(); - /* Enable all GPIOs clocks * TODO: more fine-grained enabling for power saving */ diff --git a/board/spring/board.c b/board/spring/board.c index ed9a269516..2eb324929d 100644 --- a/board/spring/board.c +++ b/board/spring/board.c @@ -8,7 +8,6 @@ #include "chipset.h" #include "common.h" #include "console.h" -#include "dma.h" #include "extpower.h" #include "gaia_power.h" #include "gpio.h" @@ -115,8 +114,6 @@ void configure_board(void) { uint32_t val; - dma_init(); - /* Enable all GPIOs clocks * TODO: more fine-grained enabling for power saving */ diff --git a/chip/stm32/dma.c b/chip/stm32/dma.c index c5d1c5e493..06f65e12f9 100644 --- a/chip/stm32/dma.c +++ b/chip/stm32/dma.c @@ -1,11 +1,12 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ -#include "board.h" +#include "common.h" #include "console.h" #include "dma.h" +#include "hooks.h" #include "registers.h" #include "task.h" #include "timer.h" @@ -192,7 +193,7 @@ void dma_test(void) } #endif /* CONFIG_DMA_HELP */ -void dma_init(void) +static void dma_init(void) { int i; @@ -203,6 +204,7 @@ void dma_init(void) for (i = 0; i < DMA_NUM_CHANNELS; i++) id[i] = TASK_ID_INVALID; } +DECLARE_HOOK(HOOK_INIT, dma_init, HOOK_PRIO_INIT_DMA); int dma_wait(int channel) { diff --git a/chip/stm32/dma.h b/include/dma.h index 4aed23ff05..c784558612 100644 --- a/chip/stm32/dma.h +++ b/include/dma.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -190,11 +190,6 @@ void dma_dump(unsigned channel); void dma_test(void); /** - * Init DMA peripheral ready for use - */ -void dma_init(void); - -/** * Clear the DMA interrupt/event flags for a given channel * * @param channel Which channel's isr to clear (DMAC_...) diff --git a/include/hooks.h b/include/hooks.h index 71939d05da..084e9bb36b 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -17,6 +17,8 @@ enum hook_priority { HOOK_PRIO_LAST = 9999, /* Lowest priority */ /* Specific hook vales for HOOK_INIT */ + /* DMA inits before ADC, I2C, SPI */ + HOOK_PRIO_INIT_DMA = HOOK_PRIO_FIRST + 1, /* LPC inits before modules which need memory-mapped I/O */ HOOK_PRIO_INIT_LPC = HOOK_PRIO_FIRST + 1, /* Chipset inits before modules which need to know its initial state. */ |