Commit Graph

5 Commits

Author SHA1 Message Date
Vic Yang
09db229f21 Make DMA interface chip independent
The common DMA interface should not include chip dependent stuff.
Otherwise we cannot share DMA interface across chips.

BUG=None
TEST=make buildall
BRANCH=None

Change-Id: I9e0d0c0637520c613747110d6c65d3b800e01704
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/205066
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-06-23 21:48:33 +00:00
Randall Spangler
e6401d2e83 Initalize DMA before UART
This is in preparation for enabling DMA-based UART transfers, to
improve UART performance on STM32.

BUG=chrome-os-partner:20485
BRANCH=none
TEST=Boot pit.  Host commands should still be received; this verifies DMA
     is still operational.

Change-Id: Ibc3b2e2cd187547eb61b85e4a086704accd7f2fb
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/168810
2013-09-10 23:46:07 +00:00
Randall Spangler
31439d13e4 stm32: Clean up DMA register usage
Bitfields are now in registers.h where they belong.

BUG=chrome-os-partner:20529
BRANCH=none
TEST='crosec test' from u-boot still works

Change-Id: I726550a32b61111c906c1b10c628c5e47eff74fb
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/60179
2013-06-27 12:48:06 -07:00
Randall Spangler
ab6546cbaa Clean up DMA module and interface.
Explicitly use enum for dma_channel, instead of ints (since channel is
1-based in the docs and 0-based in the enum).  Add enum values for
other channels like USART.

Use volatile structs instead of typecasting through REG32().

Other assorted code cleanup.

Remove DMA2 partial support, since neither STM32F100R8 nor STM32L151x
has hardware support for it and it cluttered the code.

No functional changes.

BUG=chrome-os-partner:20485
BRANCH=none
TEST=from pit root shell, 'ectool version' still works

Change-Id: Ifdd62fb287c608a684ba8fa16934dfcab83ee609
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59949
2013-06-26 09:08:24 -07:00
Randall Spangler
4d1aadaf60 Trigger dma_init() via HOOK_INIT
There's no need for it to be initalized in board_init(); it just needs
to be done before ADC / I2C / SPI initialize.

BUG=chrome-os-partner:18343
BRANCH=none
TEST=boot spring; verify EC communication and 'adc' console command still work

Change-Id: I6039848fe031222d5ca59b459adfe18fc3e8ef08
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47182
Reviewed-by: Vic Yang <victoryang@chromium.org>
2013-04-03 11:49:07 -07:00