| 1 | From b8b3acbe6077b4736f641ec445be8a42cdd1f08b Mon Sep 17 00:00:00 2001 |
| 2 | From: John Crispin <blogic@openwrt.org> |
| 3 | Date: Fri, 9 Nov 2012 12:16:14 +0100 |
| 4 | Subject: [PATCH 3/6] MIPS: lantiq: verbose init of dma core |
| 5 | |
| 6 | Print the hardware revision and port/channel info when starting the dma core. |
| 7 | |
| 8 | Signed-off-by: John Crispin <blogic@openwrt.org> |
| 9 | Patchwork: http://patchwork.linux-mips.org/patch/4520 |
| 10 | --- |
| 11 | arch/mips/lantiq/xway/dma.c | 9 ++++++++- |
| 12 | 1 file changed, 8 insertions(+), 1 deletion(-) |
| 13 | |
| 14 | diff --git a/arch/mips/lantiq/xway/dma.c b/arch/mips/lantiq/xway/dma.c |
| 15 | index 55d2c4f..b5d76d1 100644 |
| 16 | --- a/arch/mips/lantiq/xway/dma.c |
| 17 | +++ b/arch/mips/lantiq/xway/dma.c |
| 18 | @@ -25,6 +25,7 @@ |
| 19 | #include <lantiq_soc.h> |
| 20 | #include <xway_dma.h> |
| 21 | |
| 22 | +#define LTQ_DMA_ID 0x08 |
| 23 | #define LTQ_DMA_CTRL 0x10 |
| 24 | #define LTQ_DMA_CPOLL 0x14 |
| 25 | #define LTQ_DMA_CS 0x18 |
| 26 | @@ -214,6 +215,7 @@ ltq_dma_init(struct platform_device *pdev) |
| 27 | { |
| 28 | struct clk *clk; |
| 29 | struct resource *res; |
| 30 | + unsigned id; |
| 31 | int i; |
| 32 | |
| 33 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 34 | @@ -243,7 +245,12 @@ ltq_dma_init(struct platform_device *pdev) |
| 35 | ltq_dma_w32(DMA_POLL | DMA_CLK_DIV4, LTQ_DMA_CPOLL); |
| 36 | ltq_dma_w32_mask(DMA_CHAN_ON, 0, LTQ_DMA_CCTRL); |
| 37 | } |
| 38 | - dev_info(&pdev->dev, "init done\n"); |
| 39 | + |
| 40 | + id = ltq_dma_r32(LTQ_DMA_ID); |
| 41 | + dev_info(&pdev->dev, |
| 42 | + "Init done - hw rev: %X, ports: %d, channels: %d\n", |
| 43 | + id & 0x1f, (id >> 16) & 0xf, id >> 20); |
| 44 | + |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | -- |
| 49 | 1.7.10.4 |
| 50 | |
| 51 | |