Skip to contentSkip to conversation

gpmc, EXPORT_SYMBOLS, west bridge related

PATCH David Cross 3 participants 6 messages Sep 7, 2010 – Sep 9, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

This patch exports some of the gpmc driver functions in OMAP3. The purpose behind this patch is to allow device drivers compiled as loadable modules to be interfaced to the GPMC. I am hoping that Tony is the correct maintainer and willing to ACK this change. Please let me know if there are any issues or concerns with this patch.
Thanks,
David

arch/arm/mach-omap2/gpmc.c +3 -0
diff -uprN -X linux-next-vanilla/Documentation/dontdiff linux-next-vanilla/arch/arm/mach-omap2/gpmc.c linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c
@@ -133,6 +133,7 @@ void gpmc_cs_write_reg(int cs, int idx, 
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);
 
 u32 gpmc_cs_read_reg(int cs, int idx)
 {
@@ -141,6 +142,7 @@ u32 gpmc_cs_read_reg(int cs, int idx)
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	return __raw_readl(reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_read_reg);
 
 /* TODO: Add support for gpmc_fck to clock framework and use it */
 unsigned long gpmc_get_fclk_period(void)
@@ -294,6 +296,7 @@ int gpmc_cs_set_timings(int cs, const st
 
 	return 0;
 }
+EXPORT_SYMBOL(gpmc_cs_set_timings);
 
 static void gpmc_cs_enable_mem(int cs, u32 base, u32 size)
 {

---------------------------------------------------------------
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
---------------------------------------------------------------

#1 lore raw
Quoted 13 lines · David Cross

This patch exports some of the gpmc driver functions in OMAP3. The purpose behind this patch is to allow device drivers compiled as loadable modules to be interfaced to the GPMC. I am hoping that Tony is the correct maintainer and willing to ACK this change. Please let me know if there are any issues or concerns with this patch.
Thanks,
David

diff -uprN -X linux-next-vanilla/Documentation/dontdiff linux-next-vanilla/arch/arm/mach-omap2/gpmc.c linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c

arch/arm/mach-omap2/gpmc.c void gpmc_cs_write_reg(int cs, int idx, · line 136

Quoted 4 lines
arch/arm/mach-omap2/gpmc.c +1 -0
@@ -133,6 +133,7 @@ void gpmc_cs_write_reg(int cs, int idx, 
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);

EXPORT_SYMBOL_GPL() perhaps?

What about platforms that don't have this symbol, how will the driver build properly then? Shouldn't something like this be in a arch-neutral place in the kernel tree?

thanks,

greg k-h

#2 lore raw
Quoted 5 lines

From: Greg KH [mailto:[email protected]]

Quoted 1 line · David Cross

This patch exports some of the gpmc driver functions in OMAP3. The

purpose behind this patch

Quoted 3 lines
Quoted 1 line

is to allow device drivers compiled as loadable modules to be interfaced

to the GPMC. I am

Quoted 1 line

hoping that Tony is the correct maintainer and willing to ACK this

change. Please let me know

Quoted 7 lines
Quoted 7 lines

if there are any issues or concerns with this patch. Thanks,
David

diff -uprN -X linux-next-vanilla/Documentation/dontdiff

linux-next-vanilla/arch/arm/mach-omap2/gpmc.c
linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c

Quoted 1 line
Quoted 1 line

--- linux-next-vanilla/arch/arm/mach-omap2/gpmc.c 2010-08-31

19:32:51.000000000 -0700

Quoted 1 line
Quoted 1 line

+++ linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c 2010-09-01

16:10:21.000000000 -0700

Quoted 7 lines

arch/arm/mach-omap2/gpmc.c void gpmc_cs_write_reg(int cs, int idx, · line 136

Quoted 5 lines
arch/arm/mach-omap2/gpmc.c +1 -0
@@ -133,6 +133,7 @@ void gpmc_cs_write_reg(int cs, int idx, 
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);

EXPORT_SYMBOL_GPL() perhaps?

I don't have an issue with that, though I am not sure I understand why we would want to limit the usage of the function to GPL'd modules. It is probably Tony's call assuming he is ok with exporting the symbol.

Quoted 2 lines

What about platforms that don't have this symbol, how will the driver build properly then?

The driver will require some sort of HAL to build, this is part of the reason for the Kconfig changes. They require a HAL to be selected before the driver can be included. A platform which does not have a gpmc specifically will have some method of configuring the memory interface to talk with an external chip. In that case, whatever functions are used for memory interface configuration will be used.

Quoted 2 lines

Shouldn't something like this be in a arch-neutral place in the kernel tree?

I don't think so, the inclusion of west bridge is architecture specific based on the need to configure an external memory interface to talk to it.

Thanks,
david

---------------------------------------------------------------
This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.
---------------------------------------------------------------

maintainer
#3 lore raw
Quoted 31 lines · David Cross
Quoted 5 lines

From: Greg KH [mailto:[email protected]]

Quoted 1 line · David Cross

This patch exports some of the gpmc driver functions in OMAP3. The

purpose behind this patch

Quoted 3 lines
Quoted 1 line

is to allow device drivers compiled as loadable modules to be interfaced

to the GPMC. I am

Quoted 1 line

hoping that Tony is the correct maintainer and willing to ACK this

change. Please let me know

Quoted 7 lines
Quoted 7 lines

if there are any issues or concerns with this patch. Thanks,
David

diff -uprN -X linux-next-vanilla/Documentation/dontdiff

linux-next-vanilla/arch/arm/mach-omap2/gpmc.c
linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c

Quoted 1 line
Quoted 1 line

--- linux-next-vanilla/arch/arm/mach-omap2/gpmc.c 2010-08-31

19:32:51.000000000 -0700

Quoted 1 line
Quoted 1 line

+++ linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c 2010-09-01

16:10:21.000000000 -0700

Quoted 7 lines

arch/arm/mach-omap2/gpmc.c void gpmc_cs_write_reg(int cs, int idx, · line 136

Quoted 5 lines
arch/arm/mach-omap2/gpmc.c +1 -0
@@ -133,6 +133,7 @@ void gpmc_cs_write_reg(int cs, int idx, 
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);

EXPORT_SYMBOL_GPL() perhaps?

Quoted 3 lines

I don't have an issue with that, though I am not sure I understand why we would want to limit the usage of the function to GPL'd modules. It is probably Tony's call assuming he is ok with exporting the symbol.

Exporting these is not a good idea, it should be done in the platform init code like I replied in another message.

Regards,

Tony

maintainer
#4 lore raw
In reply to Greg KH
Quoted 21 lines · Greg KH
Quoted 13 lines · David Cross

This patch exports some of the gpmc driver functions in OMAP3. The purpose behind this patch is to allow device drivers compiled as loadable modules to be interfaced to the GPMC. I am hoping that Tony is the correct maintainer and willing to ACK this change. Please let me know if there are any issues or concerns with this patch.
Thanks,
David

diff -uprN -X linux-next-vanilla/Documentation/dontdiff linux-next-vanilla/arch/arm/mach-omap2/gpmc.c linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c

arch/arm/mach-omap2/gpmc.c void gpmc_cs_write_reg(int cs, int idx, · line 136

Quoted 4 lines
arch/arm/mach-omap2/gpmc.c +1 -0
@@ -133,6 +133,7 @@ void gpmc_cs_write_reg(int cs, int idx, 
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);

EXPORT_SYMBOL_GPL() perhaps?

Quoted 3 lines

What about platforms that don't have this symbol, how will the driver build properly then? Shouldn't something like this be in a arch-neutral place in the kernel tree?

I don't think exporting these functions is a good idea, so NAK from me for that.

All the drivers should be generic, and whatever needs to be done that's omap specific should be done in the platform init code.

If the driver needs to reconfigure something, such as memory timings, it can be done by passing a retime function pointer to the driver in the platform_data. Then the driver can call that function if it exists.

Regards,

Tony

#5 lore raw
Quoted 26 lines · Tony Lindgren
Quoted 21 lines · Greg KH
Quoted 13 lines · David Cross

This patch exports some of the gpmc driver functions in OMAP3. The purpose behind this patch is to allow device drivers compiled as loadable modules to be interfaced to the GPMC. I am hoping that Tony is the correct maintainer and willing to ACK this change. Please let me know if there are any issues or concerns with this patch.
Thanks,
David

diff -uprN -X linux-next-vanilla/Documentation/dontdiff linux-next-vanilla/arch/arm/mach-omap2/gpmc.c linux-next-incl-sdk/arch/arm/mach-omap2/gpmc.c

arch/arm/mach-omap2/gpmc.c void gpmc_cs_write_reg(int cs, int idx, · line 136

Quoted 4 lines
arch/arm/mach-omap2/gpmc.c +1 -0
@@ -133,6 +133,7 @@ void gpmc_cs_write_reg(int cs, int idx, 
 	reg_addr = gpmc_base + GPMC_CS0_OFFSET + (cs * GPMC_CS_SIZE) + idx;
 	__raw_writel(val, reg_addr);
 }
+EXPORT_SYMBOL(gpmc_cs_write_reg);

EXPORT_SYMBOL_GPL() perhaps?

Quoted 3 lines

What about platforms that don't have this symbol, how will the driver build properly then? Shouldn't something like this be in a arch-neutral place in the kernel tree?

Quoted 5 lines

I don't think exporting these functions is a good idea, so NAK from me for that.

All the drivers should be generic, and whatever needs to be done that's omap specific should be done in the platform init code.

Ah, that makes more sense. David, care to make those changes?

thanks,

greg k-h