Patchwork drivers vs. obj

login
register
about
Submitter Myles Watson
Date 2009-09-24 20:59:03
Message ID <2831fecf0909241359u7397c0cbt62b95f346fe9e5d@mail.gmail.com>
Download mbox | patch
Permalink /patch/297/
State Superseded
Headers show

Comments

Myles Watson - 2009-09-24 20:59:03
On Thu, Sep 24, 2009 at 12:52 AM, Stefan Reinauer <stepan@coresystems.de>wrote:
Myles Watson wrote:
> Are there other differences?  Should I2C devices use objects, since
> you can't scan for them?

Some structures defined in the code are put in an extra section in the
binary for enumeration. Those are:

#define __console    __attribute__((used,
__section__(".rodata.console_drivers")))
#define __cpu_driver __attribute__((used,__section__(".rodata.cpu_driver")))
#define __pci_driver __attribute__((used,__section__(".rodata.pci_driver")))

All others don't need to be "drivers"

Stefan

---------------
Based on that, here's a patch that changes drivers that aren't console, pci,
or cpu, to obj.

The most common one was mainboard.c as a driver.

Boot tested with Tyan s2895.

Signed-off-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles

PS.  It looks like the rtl8168 driver ought to go somewhere more general in
the tree.
Stefan Reinauer - 2009-09-25 20:25:08
Myles Watson wrote:
> PS.  It looks like the rtl8168 driver ought to go somewhere more
> general in the tree.

It's not really a driver but only keeps the device allocator from trying
to execute an option rom where there is none. I'm not sure if that
really happens on other boards with that chip...

Stefan
Myles Watson - 2009-09-25 21:28:07
On Fri, Sep 25, 2009 at 2:25 PM, Stefan Reinauer <stepan@coresystems.de> wrote:
> Myles Watson wrote:
>> PS.  It looks like the rtl8168 driver ought to go somewhere more
>> general in the tree.
>
> It's not really a driver but only keeps the device allocator from trying
> to execute an option rom where there is none. I'm not sure if that
> really happens on other boards with that chip...

I don't know how common that is.  Maybe there should be a flavor of
the onboard driver for that.

Thanks,
Myles
Stefan Reinauer - 2009-09-25 21:31:35
Myles Watson wrote:
> On Fri, Sep 25, 2009 at 2:25 PM, Stefan Reinauer <stepan@coresystems.de> wrote:
>   
>> Myles Watson wrote:
>>     
>>> PS.  It looks like the rtl8168 driver ought to go somewhere more
>>> general in the tree.
>>>       
>> It's not really a driver but only keeps the device allocator from trying
>> to execute an option rom where there is none. I'm not sure if that
>> really happens on other boards with that chip...
>>     
>
> I don't know how common that is.  Maybe there should be a flavor of
> the onboard driver for that.
>   

Ah, I looked at that driver today... Should we drop that, now that we
have CBFS everywhere?
It was only used for onboard pci devices with option roms in the system
bios. Which is no longer done that way...
Myles Watson - 2009-09-25 21:34:49
>
> >>> PS.  It looks like the rtl8168 driver ought to go somewhere more
> >>> general in the tree.
>
> Ah, I looked at that driver today... Should we drop that, now that we
> have CBFS everywhere?
> It was only used for onboard pci devices with option roms in the system
> bios. Which is no longer done that way...
>

I'd ack that patch.

Myles
Stefan Reinauer - 2009-09-25 21:47:32
Myles Watson wrote:
>
>
>     >>> PS.  It looks like the rtl8168 driver ought to go somewhere more
>     >>> general in the tree.
>
>     Ah, I looked at that driver today... Should we drop that, now that we
>     have CBFS everywhere?
>     It was only used for onboard pci devices with option roms in the
>     system
>     bios. Which is no longer done that way...
>
>  
> I'd ack that patch.
Ok, I put it on my todo list.. right now there's 139 references of that
driver in the code, so it's more than a quick shot on a tired evening..
BTW, I am hunting another bug with an onboard rtl8168 that comes up as
an 8129 after reset... (Seems it can't read its EEPROM anymore after
Linux talked to it) .. hope to get a patch done for that today.

Stefan
Myles Watson - 2009-09-29 21:44:25
On Thu, Sep 24, 2009 at 2:59 PM, Myles Watson <mylesgw@gmail.com> wrote:
>
>
>
> On Thu, Sep 24, 2009 at 12:52 AM, Stefan Reinauer <stepan@coresystems.de>
> wrote:
> Myles Watson wrote:
>> Are there other differences?  Should I2C devices use objects, since
>> you can't scan for them?
>
> Some structures defined in the code are put in an extra section in the
> binary for enumeration. Those are:
>
> #define __console    __attribute__((used,
> __section__(".rodata.console_drivers")))
> #define __cpu_driver __attribute__((used,__section__(".rodata.cpu_driver")))
> #define __pci_driver __attribute__((used,__section__(".rodata.pci_driver")))
>
> All others don't need to be "drivers"
>
> Stefan
>
> ---------------
> Based on that, here's a patch that changes drivers that aren't console, pci,
> or cpu, to obj.
>
> The most common one was mainboard.c as a driver.
>
> Boot tested with Tyan s2895.
>
> Signed-off-by: Myles Watson <mylesgw@gmail.com>

Ping.

Patch

Index: svn/src/mainboard/Makefile.romccboard.inc
===================================================================
--- svn.orig/src/mainboard/Makefile.romccboard.inc
+++ svn/src/mainboard/Makefile.romccboard.inc
@@ -37,7 +37,7 @@  ldscript-y += ../../../../src/cpu/x86/16
 ldscript-y += ../../../../src/arch/i386/lib/id.lds
 ldscript-y += ../../../../src/arch/i386/lib/failover.lds
 
-driver-y += mainboard.o
+obj-y += mainboard.o
 
 obj-$(CONFIG_HAVE_MP_TABLE) += mptable.o
 obj-$(CONFIG_HAVE_PIRQ_TABLE) += irq_tables.o
Index: svn/src/mainboard/amd/serengeti_cheetah/Makefile.inc
===================================================================
--- svn.orig/src/mainboard/amd/serengeti_cheetah/Makefile.inc
+++ svn/src/mainboard/amd/serengeti_cheetah/Makefile.inc
@@ -19,7 +19,7 @@ 
 ## MA 02110-1301 USA
 ##
 
-driver-y += mainboard.o
+obj-y += mainboard.o
 
 # Needed by irq_tables and mptable and acpi_tables.
 obj-y += get_bus_conf.o
@@ -33,7 +33,7 @@  obj-$(CONFIG_HAVE_ACPI_TABLES) += fadt.o
 obj-$(CONFIG_ACPI_SSDTX_NUM) += ssdt2.o
 obj-$(CONFIG_ACPI_SSDTX_NUM) += ssdt3.o
 obj-$(CONFIG_ACPI_SSDTX_NUM) += ssdt4.o
-driver-y += ../../../drivers/i2c/i2cmux/i2cmux.o
+obj-y += ../../../drivers/i2c/i2cmux/i2cmux.o
 
 # This is part of the conversion to init-obj and away from included code.
 
Index: svn/src/mainboard/kontron/986lcd-m/Makefile.inc
===================================================================
--- svn.orig/src/mainboard/kontron/986lcd-m/Makefile.inc
+++ svn/src/mainboard/kontron/986lcd-m/Makefile.inc
@@ -23,7 +23,7 @@ 
 ## This mainboard requires DCACHE_AS_RAM enabled. It won't work without.
 ##
 
-driver-y += mainboard.o
+obj-y += mainboard.o
 driver-y += rtl8168.o
 
 #obj-y += ../../../southbridge/intel/i82801gx/i82801gx_reset.c
Index: svn/src/mainboard/tyan/Makefile.s289x.inc
===================================================================
--- svn.orig/src/mainboard/tyan/Makefile.s289x.inc
+++ svn/src/mainboard/tyan/Makefile.s289x.inc
@@ -23,7 +23,7 @@ 
 ## This mainboard requires DCACHE_AS_RAM enabled. It won't work without.
 ##
 
-driver-y +=  mainboard.o
+obj-y +=  mainboard.o
 
 #needed by irq_tables and mptable and acpi_tables
 obj-y += get_bus_conf.o
@@ -32,8 +32,6 @@  obj-$(CONFIG_HAVE_PIRQ_TABLE) += irq_tab
 obj-$(CONFIG_HAVE_ACPI_TABLES) +=  dsdt.o
 obj-$(CONFIG_HAVE_ACPI_TABLES) +=  acpi_tables.o
 
-#driver-y += ../../../drivers/i2c/i2cmux/i2cmux.o
-
 # This is part of the conversion to init-obj and away from included code.
 
 initobj-y += crt0.o
Index: svn/src/mainboard/tyan/s2881/Makefile.inc
===================================================================
--- svn.orig/src/mainboard/tyan/s2881/Makefile.inc
+++ svn/src/mainboard/tyan/s2881/Makefile.inc
@@ -1,2 +1,2 @@ 
 include $(src)/mainboard/tyan/Makefile.s289x.inc
-driver-$(CONFIG_BOARD_TYAN_S2881) += ../../../drivers/i2c/adm1027/adm1027.o
+obj-$(CONFIG_BOARD_TYAN_S2881) += ../../../drivers/i2c/adm1027/adm1027.o
Index: svn/src/mainboard/tyan/s2892/Makefile.inc
===================================================================
--- svn.orig/src/mainboard/tyan/s2892/Makefile.inc
+++ svn/src/mainboard/tyan/s2892/Makefile.inc
@@ -1,3 +1,3 @@ 
 include $(src)/mainboard/tyan/Makefile.s289x.inc
 
-driver-y += ../../../drivers/i2c/adm1027/adm1027.o
+obj-y += ../../../drivers/i2c/adm1027/adm1027.o
Index: svn/src/mainboard/via/vt8454c/Makefile.inc
===================================================================
--- svn.orig/src/mainboard/via/vt8454c/Makefile.inc
+++ svn/src/mainboard/via/vt8454c/Makefile.inc
@@ -17,7 +17,7 @@ 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 ##
 
-driver-y += mainboard.o
+obj-y += mainboard.o
 
 obj-$(CONFIG_HAVE_MP_TABLE) += mptable.o
 obj-$(CONFIG_HAVE_PIRQ_TABLE) += irq_tables.o
Index: svn/src/mainboard/asus/m2v-mx_se/Makefile.inc
===================================================================
--- svn.orig/src/mainboard/asus/m2v-mx_se/Makefile.inc
+++ svn/src/mainboard/asus/m2v-mx_se/Makefile.inc
@@ -20,7 +20,7 @@ 
 ## MA 02110-1301 USA
 ##
 
-driver-y +=  mainboard.o
+obj-y +=  mainboard.o
 
 #needed by irq_tables and mptable and acpi_tables
 obj-$(CONFIG_HAVE_ACPI_TABLES) +=  dsdt.o