davinci: create new common platform header for davinci
PATCH 4/4 davinci: create new common platform header for davinci
remove the code from individual platform header files for dm365, dm355, dm644x and dm646x and consolidate it into a single and common header file dmx.h.
Include the new header file in individual platform header files as a pre-cursor for deleting these headers in follow up patches.
--- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 6 ++- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 5 ++- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- arch/arm/mach-davinci/include/mach/dm355.h | 32 ----------- arch/arm/mach-davinci/include/mach/dm365.h | 40 -------------- arch/arm/mach-davinci/include/mach/dm644x.h | 40 -------------- arch/arm/mach-davinci/include/mach/dmx.h | 77 +++++++++++++++++++++++++++ drivers/media/video/davinci/vpif.h | 2 +- drivers/media/video/davinci/vpif_capture.h | 1 + drivers/media/video/davinci/vpif_display.c | 2 +- 18 files changed, 98 insertions(+), 125 deletions(-) delete mode 100644 arch/arm/mach-davinci/include/mach/dm355.h delete mode 100644 arch/arm/mach-davinci/include/mach/dm365.h delete mode 100644 arch/arm/mach-davinci/include/mach/dm644x.h create mode 100644 arch/arm/mach-davinci/include/mach/dmx.h
arch/arm/mach-davinci/board-dm355-evm.c +1 -1
@@ -26,7 +26,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -#include <mach/dm355.h> +#include <mach/dmx.h> #include <mach/i2c.h> #include <mach/serial.h> #include <mach/nand.h>
arch/arm/mach-davinci/board-dm355-leopard.c +1 -1
@@ -23,7 +23,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -#include <mach/dm355.h> +#include <mach/dmx.h> #include <mach/i2c.h> #include <mach/serial.h> #include <mach/nand.h>
arch/arm/mach-davinci/board-dm365-evm.c +5 -1
@@ -32,7 +32,7 @@#include <asm/mach/arch.h> #include <mach/mux.h> -#include <mach/dm365.h> +#include <mach/dmx.h> #include <mach/common.h> #include <mach/i2c.h> #include <mach/serial.h>
@@ -143,6 +143,10 @@ static struct davinci_nand_pdata davinci_nand_data = { .ecc_bits = 4, }; +#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01D10000 +#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 +#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000 +static struct resource davinci_nand_resources[] = { { .start =DM365_ASYNC_EMIF_DATA_CE0_BASE ,
arch/arm/mach-davinci/board-dm644x-evm.c +1 -1
@@ -29,7 +29,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -#include <mach/dm644x.h> +#include <mach/dmx.h> #include <mach/common.h> #include <mach/i2c.h> #include <mach/serial.h>
arch/arm/mach-davinci/board-dm646x-evm.c +4 -1
@@ -35,7 +35,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -#include <mach/dm646x.h> +#include <mach/dmx.h> #include <mach/common.h> #include <mach/serial.h> #include <mach/i2c.h>
@@ -91,6 +91,9 @@ static struct davinci_nand_pdata davinci_nand_data = { .options = 0, }; +#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 +#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 +static struct resource davinci_nand_resources[] = { { .start =DM646X_ASYNC_EMIF_CS2_SPACE_BASE ,
arch/arm/mach-davinci/board-neuros-osd2.c +1 -1
@@ -30,7 +30,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -#include <mach/dm644x.h> +#include <mach/dmx.h> #include <mach/common.h> #include <mach/i2c.h> #include <mach/serial.h>
arch/arm/mach-davinci/board-sffsdr.c +1 -1
@@ -35,7 +35,7 @@#include <asm/mach/arch.h> #include <asm/mach/flash.h> -#include <mach/dm644x.h> +#include <mach/dmx.h> #include <mach/common.h> #include <mach/i2c.h> #include <mach/serial.h>
arch/arm/mach-davinci/dm355.c +1 -1
@@ -19,7 +19,7 @@#include <asm/mach/map.h> -#include <mach/dm355.h> +#include <mach/dmx.h> #include <mach/cputype.h> #include <mach/edma.h> #include <mach/psc.h>
arch/arm/mach-davinci/dm365.c +1 -1
@@ -22,7 +22,7 @@#include <asm/mach/map.h> -#include <mach/dm365.h> +#include <mach/dmx.h> #include <mach/cputype.h> #include <mach/edma.h> #include <mach/psc.h>
arch/arm/mach-davinci/dm644x.c +1 -1
@@ -16,7 +16,7 @@#include <asm/mach/map.h> -#include <mach/dm644x.h> +#include <mach/dmx.h> #include <mach/cputype.h> #include <mach/edma.h> #include <mach/irqs.h>
arch/arm/mach-davinci/dm646x.c +1 -1
@@ -16,7 +16,7 @@#include <asm/mach/map.h> -#include <mach/dm646x.h> +#include <mach/dmx.h> #include <mach/cputype.h> #include <mach/edma.h> #include <mach/irqs.h>
arch/arm/mach-davinci/include/mach/dm355.h deleted +0 -32
@@ -1,32 +0,0 @@ -/* -* Chip specific defines for DM355 SoC -* -* Author: Kevin Hilman, Deep Root Systems, LLC -* -* 2007 (c) Deep Root Systems, LLC. This file is licensed under -* the terms of the GNU General Public License version 2. This program -* is licensed "as is" without any warranty of any kind, whether express -* or implied. -*/ -#ifndef __ASM_ARCH_DM355_H -#define __ASM_ARCH_DM355_H - -#include <mach/hardware.h> -#include <mach/asp.h> -#include <media/davinci/vpfe_capture.h> - -#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01E10000 -#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 - -#define ASP1_TX_EVT_EN 1 -#define ASP1_RX_EVT_EN 2 - -struct spi_board_info ; - -void __init dm355_init (void ); -void dm355_init_spi0 (unsigned chipselect_mask, -struct spi_board_info *info,unsigned len); -void __init dm355_init_asp1 (u32 evt_enable,struct snd_platform_data *pdata); -void dm355_set_vpfe_config (struct vpfe_config *cfg); - -#endif /* __ASM_ARCH_DM355_H */
arch/arm/mach-davinci/include/mach/dm365.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* Copyright (C) 2009 Texas Instruments Incorporated -* -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU General Public License as -* published by the Free Software Foundation version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ -#ifndef __ASM_ARCH_DM365_H -#define __ASM_ARCH_DM665_H - -#include <linux/platform_device.h> -#include <linux/davinci_emac.h> -#include <mach/hardware.h> -#include <mach/asp.h> -#include <mach/keyscan.h> -#include <media/davinci/vpfe_capture.h> - -#define DAVINCI_DM365_VC_BASE (0x01D0C000) -#define DAVINCI_DMA_VC_TX 2 -#define DAVINCI_DMA_VC_RX 3 - -#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01D10000 -#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 -#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000 - -void __init dm365_init (void ); -void __init dm365_init_asp (struct snd_platform_data *pdata); -void __init dm365_init_vc (struct snd_platform_data *pdata); -void __init dm365_init_ks (struct davinci_ks_platform_data *pdata); -void __init dm365_init_rtc (void ); -void dm365_init_spi0 (unsigned chipselect_mask, -struct spi_board_info *info,unsigned len); - -void dm365_set_vpfe_config (struct vpfe_config *cfg); -#endif /* __ASM_ARCH_DM365_H */
arch/arm/mach-davinci/include/mach/dm644x.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* -* This file contains the processor specific definitions -* of the TI DM644x. -* -* Copyright (C) 2008 Texas Instruments. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -*/ -#ifndef __ASM_ARCH_DM644X_H -#define __ASM_ARCH_DM644X_H - -#include <linux/davinci_emac.h> -#include <mach/hardware.h> -#include <mach/asp.h> -#include <media/davinci/vpfe_capture.h> - -#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01E00000 -#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 -#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000 -#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000 -#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000 - -void __init dm644x_init (void ); -void __init dm644x_init_asp (struct snd_platform_data *pdata); -void dm644x_set_vpfe_config (struct vpfe_config *cfg); - -#endif /* __ASM_ARCH_DM644X_H */
arch/arm/mach-davinci/include/mach/dmx.h new file +77 -0
77 lines not on this page · raw message
drivers/media/video/davinci/vpif.h +1 -1
@@ -19,7 +19,7 @@#include <linux/io.h> #include <linux/videodev2.h> #include <mach/hardware.h> -#include <mach/dm646x.h> +#include <mach/dmx.h> #include <media/davinci/vpif.h> /* Maximum channel allowed */
drivers/media/video/davinci/vpif_capture.h +1 -0
@@ -28,6 +28,7 @@#include <media/v4l2-device.h> #include <media/videobuf-core.h> #include <media/videobuf-dma-contig.h> +#include <mach/dmx.h> #include <media/davinci/vpif.h> #include "vpif.h"
drivers/media/video/davinci/vpif_display.c +1 -1
@@ -40,7 +40,7 @@#include <media/v4l2-ioctl.h> #include <media/v4l2-chip-ident.h> -#include <mach/dm646x.h> +#include <mach/dmx.h> #include "vpif_display.h" #include "vpif.h"
Signature · 1 line
1.6.2.4
PATCH 4/4 davinci: create new common platform header for davinci
Hello.
Quoted 3 lines · Manjunath Hadli
remove the code from individual platform header files for dm365, dm355, dm644x and dm646x and consolidate it into a single and common header file
dmx.h.
Could we call it davinci.h instead?
Quoted 5 lines
Include the new header file in individual platform header files as a pre-cursor for deleting these headers in follow up patches.
Signed-off-by Manjunath Hadli <[email protected]>
[...]
Quoted 4 lines
arch/arm/mach-davinci/board-dm365-evm.c +0
-0
[...]
arch/arm/mach-davinci/board-dm365-evm.c static struct davinci_nand_pdata davinci_nand_data = { · line 148
Quoted 7 lines
arch/arm/mach-davinci/board-dm365-evm.c +3
-0@@ -143,6 +143,10 @@ static struct davinci_nand_pdata davinci_nand_data = { .ecc_bits = 4, }; +#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01D10000 +#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000 +#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
No, we don't want to duplicate those in every future DM365 board file. Leave
them in the header please.
arch/arm/mach-davinci/board-dm646x-evm.c static struct davinci_nand_pdata davinci_nand_data = { · line 96
Quoted 11 lines
arch/arm/mach-davinci/board-dm646x-evm.c +3
-0@@ -91,6 +91,9 @@ static struct davinci_nand_pdata davinci_nand_data = { .options = 0, }; +#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000 +#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000 +
No, we don't want to duplicate those in every future DM646x board file.
Leave them in the header please.
drivers/media/video/davinci/vpif_capture.h line 31
Quoted 9 lines
drivers/media/video/davinci/vpif_capture.h +1
-0@@ -28,6 +28,7 @@#include <media/v4l2-device.h> #include <media/videobuf-core.h> #include <media/videobuf-dma-contig.h> +#include <mach/dmx.h>
Why, if it didn't #include any of the deleted headers before?
WBR, Sergei
PATCH 4/4 davinci: create new common platform header for davinci
In reply to Manjunath HadliHello.
Quoted 24 lines · Manjunath Hadli
remove the code from individual platform header files for dm365, dm355, dm644x and dm646x and consolidate it into a single and common header file
dmx.h.
Include the new header file in individual platform header files as a pre-cursor for deleting these headers in follow up patches.Signed-off-by Manjunath Hadli <[email protected]>--- arch/arm/mach-davinci/board-dm355-evm.c | 2 +- arch/arm/mach-davinci/board-dm355-leopard.c | 2 +- arch/arm/mach-davinci/board-dm365-evm.c | 6 ++- arch/arm/mach-davinci/board-dm644x-evm.c | 2 +- arch/arm/mach-davinci/board-dm646x-evm.c | 5 ++- arch/arm/mach-davinci/board-neuros-osd2.c | 2 +- arch/arm/mach-davinci/board-sffsdr.c | 2 +- arch/arm/mach-davinci/dm355.c | 2 +- arch/arm/mach-davinci/dm365.c | 2 +- arch/arm/mach-davinci/dm644x.c | 2 +- arch/arm/mach-davinci/dm646x.c | 2 +- arch/arm/mach-davinci/include/mach/dm355.h | 32 ----------- arch/arm/mach-davinci/include/mach/dm365.h | 40 -------------- arch/arm/mach-davinci/include/mach/dm644x.h | 40 -------------- arch/arm/mach-davinci/include/mach/dmx.h | 77 +++++++++++++++++++++++++++
Quoted 8 lines
drivers/media/video/davinci/vpif.h | 2 +- drivers/media/video/davinci/vpif_capture.h | 1 + drivers/media/video/davinci/vpif_display.c | 2 +- 18 files changed, 98 insertions(+), 125 deletions(-) delete mode 100644 arch/arm/mach-davinci/include/mach/dm355.h delete mode 100644 arch/arm/mach-davinci/include/mach/dm365.h delete mode 100644 arch/arm/mach-davinci/include/mach/dm644x.h create mode 100644 arch/arm/mach-davinci/include/mach/dmx.h
BTW, you forgot to remove <mach/dm646x.h>...
WBR, Sergei
PATCH 4/4 davinci: create new common platform header for davinci
In reply to Manjunath HadliQuoted 8 lines · On Friday 20 May 2011 16:14:01 Manjunath Hadli wrote:
remove the code from individual platform header files for dm365, dm355, dm644x and dm646x and consolidate it into a single and common header file
dmx.h.
Include the new header file in individual platform header files as a pre-cursor for deleting these headers in follow up patches.Signed-off-by Manjunath Hadli <[email protected]>
I probably missed the discussion that led to this patch, but please explain the motivation behind the change in the changelog.
Your current changelog reads like this is pointless churn, which may or may not be the case. The diffstat shows 27 lines being removed in total, which is roughly the amount of copyright headers.
Arnd
PATCH 4/4 davinci: create new common platform header for davinci
Hi Arnd,
Quoted 10 lines · Arnd Bergmann
Quoted 8 lines · On Friday 20 May 2011 16:14:01 Manjunath Hadli wrote:
remove the code from individual platform header files for dm365, dm355, dm644x and dm646x and consolidate it into a single and common header file
dmx.h.
Include the new header file in individual platform header files as a pre-cursor for deleting these headers in follow up patches.Signed-off-by Manjunath Hadli <[email protected]>
Quoted 7 lines
I probably missed the discussion that led to this patch, but please explain the motivation behind the change in the changelog.
Your current changelog reads like this is pointless churn, which may or may not be the case. The diffstat shows 27 lines being removed in total, which is roughly the amount of copyright headers.
Well, it started with the need to get rid of using IO_ADDRESS() on "system module" which is a bunch of SoC specific registers found on dm365, dm355, dm644x and dm646x SoCs (all at the same base address, but having different SoC specific register content).
Please see the previous discussion here:
http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2011-April/022523.html
We could have probably avoided the churn by sticking DAVINCI_SYSMODULE_VIRT() into yet another (unrelated or new) header file, but it made sense to have a single header file containing platform private stuff for all these SoCs.
Thanks,
Sekhar
PATCH 4/4 davinci: create new common platform header for davinci
Quoted 4 lines · Sekhar
Well, it started with the need to get rid of using
IO_ADDRESS()on "system module" which is a bunch of SoC specific registers found on dm365, dm355, dm644x and dm646x SoCs (all at the same base address, but having different SoC specific register content).
That part certainly sounds useful, but I still don't understand how it relates to this patch here, especially since you are not actually adding the davinci_sysmodbase.
Your other three patches also look good to me.
Quoted 7 lines
Please see the previous discussion here:
http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2011-April/022523.html
We could have probably avoided the churn by sticking
DAVINCI_SYSMODULE_VIRT()into yet another (unrelated or new) header file, but it made sense to have a single header file containing platform private stuff for all these SoCs.
In the long run, a more valuable goal would be to reduce the number of definitions in the include/mach/ directories, and since most of the stuff in the files you touch is just the interface between the soc and board files, I would recommend making them local to the directory that holds the users, i.e. arch/arm/mach-davinci/dm*.h. Anything that still needs to be exported to drivers can either stay in arch/arm/mach-davinci/include/mach/davinci.h or be moved out at a later point.
I also feel that a global pointer point to different registers depending on what SoC you run on is a rather poor interface. How about making the pointer local to mach-davinci/devices.c and just exporting high-level functions to other parts of the kernel that need access to it?
Arnd
PATCH 4/4 davinci: create new common platform header for davinci
Quoted 9 lines · Arnd Bergmann
Quoted 4 lines · Sekhar
Well, it started with the need to get rid of using
IO_ADDRESS()on "system module" which is a bunch of SoC specific registers found on dm365, dm355, dm644x and dm646x SoCs (all at the same base address, but having different SoC specific register content).That part certainly sounds useful, but I still don't understand how it relates to this patch here, especially since you are not actually adding the
davinci_sysmodbase.
The idea was to add davinci_sysmodbase to arch/arm/mach- davinci/include/mach/dmx.h created by this patch. That should probably be added to this series to make it look more meaningful.
Quoted 1 line
Your other three patches also look good to me.
Thanks (on behalf of Manju).
Quoted 8 lines
Quoted 7 lines
Please see the previous discussion here:
http://linux.davincidsp.com/pipermail/davinci-linux-open-source/2011-April/022523.html
We could have probably avoided the churn by sticking
DAVINCI_SYSMODULE_VIRT()into yet another (unrelated or new) header file, but it made sense to have a single header file containing platform private stuff for all these SoCs.
Quoted 8 lines
In the long run, a more valuable goal would be to reduce the number of definitions in the
include/mach/directories, and since most of the stuff in the files you touch is just the interface between the soc and board files, I would recommend making them local to the directory that holds the users, i.e.arch/arm/mach-davinci/dm*.h. Anything that still needs to be exported to drivers can either stay inarch/arm/mach-davinci/include/mach/davinci.hor be moved out at a later point.
Right, good point.
Quoted 4 lines
I also feel that a global pointer point to different registers depending on what SoC you run on is a rather poor interface. How about making the pointer local to
mach-davinci/devices.cand just exporting high-level functions to other parts of the kernel that need access to it?
Agreed, this should be explored. The main challenge will be in coming up high level functions usable on more than one SoC (because of the highly SoC specific nature of this functionality).
Thanks,
Sekhar