linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Module support for 8260 in 2.4(.1) kernel
@ 2001-04-20 18:51 Oliver Brown
  2001-04-20 19:03 ` Tom Rini
  2001-04-20 19:22 ` Dan Malek
  0 siblings, 2 replies; 6+ messages in thread
From: Oliver Brown @ 2001-04-20 18:51 UTC (permalink / raw)
  To: linuxppc-embedded List


I am working on loadable driver modules for the 8260. I had to make the
changes below to the ppc_ksyms.c file to export the symbols in needed.

The problems I am having are
1. The udelay marco is not exportable. Is there a substitute? For now I
am using __delay() which is not a constant delay.
2. The m8260_cpm_hostalloc() and m8260_cpm_dpalloc do not have deallocs.
I can load my module, but I can't unload it.

I've added an init_module and cleanup_module to the fcc_enet.c from
(bitkeeper 2.5 tree). Also, I had to replace all of the udelay()'s with
__delay()'s. And I've diabled the MDIO PHY support.

Any comments or suggestions would be appreciated.

Regards,
Oliver Brown

46a47,51
> /* exporting 8260 symbols for modules - OFB */
> #ifdef CONFIG_8260
> #include <asm/cpm_8260.h>
> #include <asm/mpc8260.h>
> #endif /* CONFIG_8260 - OFB */
90c95,96
< #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
---
> /* Added CONFIG_8260 to exclude symbols below - OFB */
> #if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) &&
!defined(CONFIG_8260)
94a101
>
104a112,126
> /* exporting CPM symbols for modules - OFB */
> #ifdef CONFIG_8260
> EXPORT_SYMBOL(cpmp);
> EXPORT_SYMBOL(m8260_cpm_hostalloc);
> EXPORT_SYMBOL(m8260_cpm_dpalloc);
> EXPORT_SYMBOL(m8260_cpm_setbrg);
> EXPORT_SYMBOL(m8260_cpm_fastbrg);
> EXPORT_SYMBOL(__res);
> #endif /* CONFIG_8260 */
>
> /* exporting symbols for modules - OFB */
> #if (defined(CONFIG_8260) || defined(CONFIG_8xx))
> EXPORT_SYMBOL(request_8xxirq);
> #endif /* (defined(CONFIG_8260) || defined(CONFIG_8xx)) - OFB */
>
243a266,267
>
> #ifdef CONFIG_ALL_PPC
244a269,270
> #endif /* CONFIG_ALL_PPC */
>
281a308,309
>
> #ifdef CONFIG_VT
282a311,312
> #endif /* CONFIG_VT */
>
349c379,380
< #if !defined(CONFIG_8xx) && !defined(CONFIG_4xx)
---
> /* Added CONFIG_8260 -OFB */
> #if !defined(CONFIG_8xx) && !defined(CONFIG_4xx) &&
!defined(CONFIG_8260)


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: Module support for 8260 in 2.4(.1) kernel
@ 2001-04-20 19:26 Oliver Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Oliver Brown @ 2001-04-20 19:26 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-embedded List


This diff was against a ppc_ksyms.c from kernel.org 2.4.1 tree. Below is
a unified diff. I'll try and add the __udelay to the exports.

Regards,
Oliver Brown

+++ ppc_ksyms.c	Fri Apr 20 12:16:28 2001
@@ -42,10 +42,15 @@
 #ifdef CONFIG_SMP
 #include <asm/smplock.h>
 #include <asm/smp.h>
 #endif /* CONFIG_SMP */
 #include <asm/time.h>
+/* exporting 8260 sysmbols for modules - OFB */
+#ifdef CONFIG_8260
+#include <asm/cpm_8260.h>
+#include <asm/mpc8260.h>
+#endif /* CONFIG_8260 - OFB */

 /* Tell string.h we don't want memcpy etc. as cpp defines */
 #define EXPORT_SYMTAB_STROPS

 extern void transfer_to_handler(void);
@@ -85,25 +90,42 @@
 EXPORT_SYMBOL(probe_irq_mask);
 #ifdef CONFIG_SMP
 EXPORT_SYMBOL(kernel_flag);
 #endif /* CONFIG_SMP */

-#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx)
+/* Added CONFIG_8260 to exclude symbols below - OFB */
+#if !defined(CONFIG_4xx) && !defined(CONFIG_8xx) &&
!defined(CONFIG_8260)
 EXPORT_SYMBOL_NOVERS(isa_io_base);
 EXPORT_SYMBOL_NOVERS(isa_mem_base);
 EXPORT_SYMBOL_NOVERS(pci_dram_offset);
 #endif
+
 EXPORT_SYMBOL(ISA_DMA_THRESHOLD);
 EXPORT_SYMBOL(DMA_MODE_READ);
 EXPORT_SYMBOL(DMA_MODE_WRITE);
 #ifndef CONFIG_8xx
 #if defined(CONFIG_ALL_PPC)
 EXPORT_SYMBOL(_prep_type);
 EXPORT_SYMBOL(ucSystemType);
 #endif
 #endif

+/* exporting CPM symbols for modules - OFB */
+#ifdef CONFIG_8260
+EXPORT_SYMBOL(cpmp);
+EXPORT_SYMBOL(m8260_cpm_hostalloc);
+EXPORT_SYMBOL(m8260_cpm_dpalloc);
+EXPORT_SYMBOL(m8260_cpm_setbrg);
+EXPORT_SYMBOL(m8260_cpm_fastbrg);
+EXPORT_SYMBOL(__res);
+#endif /* CONFIG_8260 */
+
+/* exporting symbols for modules - OFB */
+#if (defined(CONFIG_8260) || defined(CONFIG_8xx))
+EXPORT_SYMBOL(request_8xxirq);
+#endif /* (defined(CONFIG_8260) || defined(CONFIG_8xx)) - OFB */
+
 #if !__INLINE_BITOPS
 EXPORT_SYMBOL(set_bit);
 EXPORT_SYMBOL(clear_bit);
 EXPORT_SYMBOL(change_bit);
 EXPORT_SYMBOL(test_and_set_bit);
@@ -239,11 +261,15 @@
 EXPORT_SYMBOL(get_backlight_level);
 EXPORT_SYMBOL(set_backlight_level);
 EXPORT_SYMBOL(set_backlight_enable);
 EXPORT_SYMBOL(register_backlight_controller);
 #endif /* CONFIG_PMAC_BACKLIGHT */
+
+#ifdef CONFIG_ALL_PPC
 EXPORT_SYMBOL_NOVERS(sys_ctrler);
+#endif /* CONFIG_ALL_PPC */
+
 #ifndef CONFIG_MACH_SPECIFIC
 EXPORT_SYMBOL_NOVERS(have_of);
 #endif /* CONFIG_MACH_SPECIFIC */
 #if defined(CONFIG_ALL_PPC)
 EXPORT_SYMBOL(find_devices);
@@ -277,11 +303,15 @@
 EXPORT_SYMBOL(bootx_update_display);
 #endif
 #if defined(CONFIG_SCSI) && defined(CONFIG_ALL_PPC)
 EXPORT_SYMBOL(note_scsi_host);
 #endif
+
+#ifdef CONFIG_VT
 EXPORT_SYMBOL(kd_mksound);
+#endif /* CONFIG_VT */
+
 #ifdef CONFIG_NVRAM
 EXPORT_SYMBOL(nvram_read_byte);
 EXPORT_SYMBOL(nvram_write_byte);
 EXPORT_SYMBOL(pmac_xpram_read);
 EXPORT_SYMBOL(pmac_xpram_write);
@@ -344,11 +374,12 @@
 EXPORT_SYMBOL(ret_to_user_hook);
 EXPORT_SYMBOL(do_softirq);
 EXPORT_SYMBOL(next_mmu_context);
 EXPORT_SYMBOL(set_context);
 EXPORT_SYMBOL(mmu_context_overflow);
-#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx)
+/* Added CONFIG_8260 -OFB */
+#if !defined(CONFIG_8xx) && !defined(CONFIG_4xx) &&
!defined(CONFIG_8260)
 extern long *intercept_table;
 EXPORT_SYMBOL(intercept_table);
 #endif
 extern long *ret_from_intercept;
 EXPORT_SYMBOL(ret_from_intercept);

-----Original Message-----
From: Tom Rini [mailto:trini@kernel.crashing.org]
Sent: Friday, April 20, 2001 2:03 PM
To: Oliver Brown
Cc: linuxppc-embedded List
Subject: Re: Module support for 8260 in 2.4(.1) kernel


On Fri, Apr 20, 2001 at 01:51:00PM -0500, Oliver Brown wrote:

> I am working on loadable driver modules for the 8260. I had to make
the
> changes below to the ppc_ksyms.c file to export the symbols in needed.
>
> The problems I am having are
> 1. The udelay marco is not exportable. Is there a substitute? For now
I
> am using __delay() which is not a constant delay.

Er, you should be able to at least kludge around this and use __udelay
which skips the macro (which just does sanity checks).

> 2. The m8260_cpm_hostalloc() and m8260_cpm_dpalloc do not have
deallocs.
> I can load my module, but I can't unload it.
>
> I've added an init_module and cleanup_module to the fcc_enet.c from
> (bitkeeper 2.5 tree). Also, I had to replace all of the udelay()'s
with
> __delay()'s. And I've diabled the MDIO PHY support.

Er, what tree is this vs exactly?  Also, can you send a unified diff
next time?

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: Module support for 8260 in 2.4(.1) kernel
@ 2001-04-20 21:00 Oliver Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Oliver Brown @ 2001-04-20 21:00 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-embedded List


Dan,

I am evaluating Linux for use in a network gateway product. I agree that
the Ethernet driver would be best compiled into the kernel. However, I
need to make a custom driver for one of the FCC's using a loadable
module. I hacked up the FCC driver into a loadable module only to test
if this was possible. Also, it would be nice have loadable CPM modules
support in the kernel so the kernel doesn't have to be recompiled and
loaded for every change.

If you have any patches for the m8260_cpm_hostalloc() and
m8260_cpm_dpalloc dealloc's, I'd be happy to test them.

Regards,
Oliver

-----Original Message-----
From: Dan Malek [mailto:dan@mvista.com]
Sent: Friday, April 20, 2001 2:22 PM
To: Oliver Brown
Cc: linuxppc-embedded List
Subject: Re: Module support for 8260 in 2.4(.1) kernel


Oliver Brown wrote:

> 2. The m8260_cpm_hostalloc() and m8260_cpm_dpalloc do not have
deallocs.
> I can load my module, but I can't unload it.

Yep....I have some patches and someday I may fix it.


> I've added an init_module and cleanup_module to the fcc_enet.c from
> (bitkeeper 2.5 tree).

Since it won't work properly as a module, I would prefer you didn't
do this.  One of the reasons the CPM drivers aren't modules is there
are configuration dependencies built into the drivers.  You don't
have the flexibility to arbitrarily select any I/O configuration
at any time, the drivers have to know what may be conflicting and
avoid these configurations.  While there is an academic challenge
to make this extremely flexible, I haven't seen any production value
to this feature in use by people building real products.  If you
really need the driver, you have to build it in with consideration
of other drivers.


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread
* RE: Module support for 8260 in 2.4(.1) kernel
@ 2001-04-20 21:34 Oliver Brown
  0 siblings, 0 replies; 6+ messages in thread
From: Oliver Brown @ 2001-04-20 21:34 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-embedded List


I tried to export the __udelay() in the ppc_ksyms.c but the kernel will
not build:

	....../arch/ppc/kernel/setup.c:448 undefined reference to
'__udelay'

I'm guessing that because __delay is an inline function it can't be
exported.

Regards,
Oliver Brown

-----Original Message-----
From: Tom Rini [mailto:trini@kernel.crashing.org]
Sent: Friday, April 20, 2001 2:03 PM
To: Oliver Brown
Cc: linuxppc-embedded List
Subject: Re: Module support for 8260 in 2.4(.1) kernel


On Fri, Apr 20, 2001 at 01:51:00PM -0500, Oliver Brown wrote:

> I am working on loadable driver modules for the 8260. I had to make
the
> changes below to the ppc_ksyms.c file to export the symbols in needed.
>
> The problems I am having are
> 1. The udelay marco is not exportable. Is there a substitute? For now
I
> am using __delay() which is not a constant delay.

Er, you should be able to at least kludge around this and use __udelay
which skips the macro (which just does sanity checks).

> 2. The m8260_cpm_hostalloc() and m8260_cpm_dpalloc do not have
deallocs.
> I can load my module, but I can't unload it.
>
> I've added an init_module and cleanup_module to the fcc_enet.c from
> (bitkeeper 2.5 tree). Also, I had to replace all of the udelay()'s
with
> __delay()'s. And I've diabled the MDIO PHY support.

Er, what tree is this vs exactly?  Also, can you send a unified diff
next time?

--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-04-20 21:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-20 18:51 Module support for 8260 in 2.4(.1) kernel Oliver Brown
2001-04-20 19:03 ` Tom Rini
2001-04-20 19:22 ` Dan Malek
  -- strict thread matches above, loose matches on Subject: below --
2001-04-20 19:26 Oliver Brown
2001-04-20 21:00 Oliver Brown
2001-04-20 21:34 Oliver Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).