firewall: update to git head
[openwrt.git] / target / linux / lantiq / patches-3.7 / 0003-MIPS-lantiq-verbose-init-of-dma-core.patch
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 --- a/arch/mips/lantiq/xway/dma.c
15 +++ b/arch/mips/lantiq/xway/dma.c
16 @@ -25,6 +25,7 @@
17  #include <lantiq_soc.h>
18  #include <xway_dma.h>
19  
20 +#define LTQ_DMA_ID             0x08
21  #define LTQ_DMA_CTRL           0x10
22  #define LTQ_DMA_CPOLL          0x14
23  #define LTQ_DMA_CS             0x18
24 @@ -214,6 +215,7 @@ ltq_dma_init(struct platform_device *pde
25  {
26         struct clk *clk;
27         struct resource *res;
28 +       unsigned id;
29         int i;
30  
31         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
32 @@ -243,7 +245,12 @@ ltq_dma_init(struct platform_device *pde
33                 ltq_dma_w32(DMA_POLL | DMA_CLK_DIV4, LTQ_DMA_CPOLL);
34                 ltq_dma_w32_mask(DMA_CHAN_ON, 0, LTQ_DMA_CCTRL);
35         }
36 -       dev_info(&pdev->dev, "init done\n");
37 +
38 +       id = ltq_dma_r32(LTQ_DMA_ID);
39 +       dev_info(&pdev->dev,
40 +               "Init done - hw rev: %X, ports: %d, channels: %d\n",
41 +               id & 0x1f, (id >> 16) & 0xf, id >> 20);
42 +
43         return 0;
44  }
45