Commit Graph

556 Commits

Author SHA1 Message Date
dyoung
7d2843a545 Switch more PowerPC ports having PCI support to new-style <sys/bus.h>. 2011-07-17 23:27:02 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
dyoung
cf10107d5d #include <sys/bus.h> instead of <machine/bus.h>. 2011-07-01 18:51:52 +00:00
dyoung
59adf08e17 Per discussion at
<http://mail-index.netbsd.org/tech-kern/2010/04/02/msg007941.html>,
divide each machine's bus.h into bus_defs.h (constants & data types)
and bus_funcs.h (macro implementations of bus_space(9) routines and MD
prototypes).

Note that some bus_space(9) routines' implementation will move to .c
files from inline subroutines or macros in .h files.

I've only made the split for machine architectures where there is PCI.
All of the non-PCI-having architectures will require a similar split.

These #include files are not referenced by any (committed) Makefiles or
header files, yet.  Changes to Makefiles, to <sys/bus.h>, and to some
more machine-dependent files will dribble in before I throw the switch.
2011-07-01 17:09:58 +00:00
matt
6265330aa0 Don't include *pmap.h in assembly files. Get the needed definitions
from "assym.h".
2011-06-20 19:56:10 +00:00
jdc
2370f69f6d Add support for booting from RAID 1.
Note, that the RAID partition must be the first partition of the disk.
Reviewed by phx@.
2011-06-20 19:48:05 +00:00
matt
a4d141ba75 Don't export USER_SR if _MODULE is defined.
Add a common <powerpc/vmparam.h> like we have for <powerpc/pmap.h>
2011-06-20 08:01:13 +00:00
matt
7e37a13248 Cleanup includes. (<net/netisr.h> is handled by softints, not MD anymore,
so this can be nuked).
2011-06-20 07:18:05 +00:00
matt
d9c7720855 Don't expose port-specific if _MODULE is defined.
Don't _MACHINE_CPU_H_, _<PORT>_CPU_H_
2011-06-20 06:35:39 +00:00
matt
179b37ab20 Cleanup powerpc param.h. If compiling a MODULE, ignore port-specific stuff.
Only include <machine/cpu.h> in <powerpc/param.h> at the end.
2011-06-20 06:29:53 +00:00
matt
dcbb41139e Make a common genassym.cf (powerpc/genassym.cf) and then
only put specific stuff in foo/genassym.cf
2011-06-18 21:17:28 +00:00
matt
05b09539a2 struct device * -> device_t
struct cfdata * -> cfdata_t
use device accessors, use device_private.
some softc/device_t splits (macppc needs a bunch more)
aprint*_dev used considerably more
2011-06-18 08:08:27 +00:00
matt
e2a71f6c7b intr.h must not include cpu due to deadly embrace with SOFTINT_COUNT.
Cleanup intr.h so MD definitions can overload common definitions.
Rototill pic/intr.c.  Virtual IRQs can now be reclaimed.  separate virq
from hwirq from picirq.  Redo intr mask calculations.
tested on pmppc and macppc (MP).
2011-06-17 23:36:17 +00:00
phx
83057b124e Support disk units from multiple IDE/SATA PCI controllers. 2011-06-08 18:06:02 +00:00
matt
ec1797c173 More device_t, cfdata, CFATTACH_DECL_NEW cleanup. 2011-06-06 16:42:17 +00:00
matt
612b7ee57a struct device * -> device_t, struct cfdata * -> cfdata_t
CFATTACH_DECL(*, sizeof(struct device), -> CFATTACH_DECL_NEW(&, 0
2011-06-05 17:03:16 +00:00
matt
01fd92550a Remove <machine/atomic.h>; use <sys/atomic.h> instead.
Add <powerpc/cpuset.h> (for mpc85xx pmap).
Add some initial MP code for mpc85xx
Rework ipi code to be common across all ppcs
Change PPC to keep curlwp in %r13 while in the kernel.
Move astpending from cpu_info to mdlwp
Improve cpu_need_resched to be more MP friendly.
2011-06-05 16:52:22 +00:00
phx
ed377eee5f Add PPCBoot version from DS-207 and CS-407e. 2011-06-02 16:41:32 +00:00
phx
09f72307e2 When a drive is present, retry ATA-reset for a maximum of 10 seconds, until
successful.
2011-05-30 19:48:12 +00:00
phx
fd66150e69 When PPCBoot supports the SKnet interface it will configure it to automatically
byte-reverse all descriptors by setting a vendor-specific bit in PCI config
space. We have to clear that bit to make sure our driver can send and
receive.
2011-05-29 18:06:45 +00:00
phx
c91ba1563d Use printf() from libsa.
Ok by nisimura@.
2011-05-25 19:26:21 +00:00
dyoung
a6b2b8396b PCI_FLAGS_IO_ENABLED and PCI_FLAGS_MEM_ENABLED changed their functional
role in NetBSD (drivers are no longer supposed to write these to
pa_flags) without changing name.  Correct that.

Rename PCI_FLAGS_IO_ENABLED to PCI_FLAGS_IO_OKAY and
PCI_FLAGS_MEM_ENABLED to PCI_FLAGS_MEM_OKAY, thus making their names
consistent with the other PCI flags and poisoning 3rd-party driver
sources that use the flags in the old bad way.

This patch produces no binary changes in this set of PCI kernels when
they are compiled w/o 'options DIAGNOSTIC' and w/ -V MKREPRO=yes:

algor P4032 P5064 P6032
alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE
evbarm-el GUMSTIX HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321
evbarm-el IXDP425 IXM1200 KUROBOX_PRO
evbarm-el LUBBOCK MARVELL_NAS NAPPI NSLU2 SHEEVAPLUG SMDK2800 TEAMASA_NPWR
evbarm-el TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
evbppc OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
iyonix GENERIC
landisk GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sbmips-el GENERIC
sgimips GENERIC32_IP2x GENERIC32_IP3x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC
2011-05-17 17:34:47 +00:00
phx
7a9e3e0e9f Add Iomega Storcenter dsrtc device (DS1337). 2011-04-30 11:14:04 +00:00
phx
a5da0088ea Detect QNAP board last, because a Realtek chip at pci device 15 is used
on several boards.
2011-04-30 11:12:58 +00:00
phx
e6fc9bd646 When we stretch a short frame to 60 bytes in rge_send() do not return 60,
but the original frame size.
2011-04-29 22:21:36 +00:00
joerg
5aca2679d7 Remove Darwin, MACH and Mach-O support. 2011-04-26 15:51:22 +00:00
phx
b424687509 Priority of QNAP board detection was still too high. It should be lowest,
because a Realtek chip at pci device 15 is used on several boards. Now
NH230/All6250 detection should work again.
2011-04-26 08:08:39 +00:00
phx
40f940eba7 Add VIA VT6410 vendor/product IDs (StorCenter). 2011-04-25 18:30:18 +00:00
phx
53cc08bb65 Also scan for PCI_CLASS_RAID, when looking for disk devices. 2011-04-25 18:29:33 +00:00
phx
3525c1ef51 Detect StorCenter before QNAP, otherwise the Realtek NIC will mis-detect as
StorCenter boards as QNAP.
2011-04-25 18:28:47 +00:00
phx
756f61da3c CH3WNAS uses the same chips as a DSM-G600, so they might be compatible. 2011-04-21 13:39:54 +00:00
phx
161f7a47d9 It is probably better to flash the power LED after power-off on a DSM-G600,
to make the user aware that he needs to remove power manually.
2011-04-19 18:16:03 +00:00
phx
e122f9b9e1 Make it compile when no kernel symbols and no debugger is configured. 2011-04-19 18:06:19 +00:00
phx
e8dfac90be Some DSM-G600 use a Acard ATP865A instead of ATP865. Added its product id. 2011-04-19 17:49:38 +00:00
phx
53ec9ace10 Added a detailed description of altboot command line and boot arguments. 2011-04-19 14:12:54 +00:00
phx
847aca0706 DSM-G600: Turn off all LEDs when shutting down, to indicate the device
can be switched off.
2011-04-17 14:05:59 +00:00
phx
5892c210fd DSM-G600 has a 33.000 MHz oscillator on board. 2011-04-17 13:09:30 +00:00
phx
6aa7a17f50 ExtClk for QNAP should be the same as for Synology's 266MHz systems.
This seems logical, as both boards are very similar, and the clock precision
is ok now.
2011-04-13 18:32:21 +00:00
phx
fbb77c10f3 Enable strtc(4). Should theoretically work.
It works indeed for my DSM-G600 after I removed the battery. But there
must be something which confuses the chip later on...
2011-04-11 18:02:11 +00:00
phx
ed97e369f2 Missing comma. Make it compile again. 2011-04-10 16:30:32 +00:00
phx
73e37f5358 Set D-Link DSM-G600 power LED to solid green on start. 2011-04-09 19:56:20 +00:00
nisimura
1a92bd3dae Minor format knots; sort a model list in alphabetical order and adjust
spacing.
2011-04-08 14:09:24 +00:00
phx
36ed4e1e88 QNAP support.
Note about the D-Link firmware.
2011-04-08 08:29:07 +00:00
phx
e08320b5eb Enable all known RTC drivers. The correct RTC will automatically be chosen as
an I2C device, depending on the NAS model.
2011-04-06 18:12:15 +00:00
dyoung
d3e53912d2 Neither pci_dma64_available(), pci_probe_device(), pci_mapreg_map(9),
pci_find_rom(), pci_intr_map(9), pci_enumerate_bus(), nor the match
predicate passed to pciide_compat_intr_establish() should ever modify
their pci_attach_args argument, so make their pci_attach_args arguments
const and deal with the fallout throughout the kernel.

For the most part, these changes add a 'const' where there was no
'const' before, however, some drivers and MD code used to modify
pci_attach_args.  Now those drivers either copy their pci_attach_args
and modify the copy, or refrain from modifying pci_attach_args:

Xen: according to Manuel Bouyer, writing to pci_attach_args in
    pci_intr_map() was a leftover from Xen 2.  Probably a bug.  I
    stopped writing it.  I have not tested this change.

siside(4): sis_hostbr_match() needlessly wrote to pci_attach_args.
    Probably a bug.  I use a temporary variable.  I have not tested this
    change.

slide(4): sl82c105_chip_map() overwrote the caller's pci_attach_args.
    Probably a bug.  Use a local pci_attach_args.  I have not tested
    this change.

viaide(4): via_sata_chip_map() and via_sata_chip_map_new() overwrote the
    caller's pci_attach_args.  Probably a bug.  Make a local copy of the
    caller's pci_attach_args and modify the copy.  I have not tested
    this change.

While I'm here, make pci_mapreg_submap() static.

With these changes in place, I have tested the compilation of these
kernels:

alpha GENERIC
amd64 GENERIC XEN3_DOM0
arc GENERIC
atari HADES MILAN-PCIIDE
bebox GENERIC
cats GENERIC
cobalt GENERIC
evbarm-eb NSLU2
evbarm-el ADI_BRH ARMADILLO9 CP3100 GEMINI GEMINI_MASTER GEMINI_SLAVE GUMSTIX
	HDL_G IMX31LITE INTEGRATOR IQ31244 IQ80310 IQ80321 IXDP425 IXM1200
	KUROBOX_PRO LUBBOCK MARVELL_NAS NAPPI SHEEVAPLUG SMDK2800 TEAMASA_NPWR
	TEAMASA_NPWR_FC TS7200 TWINTAIL ZAO425
evbmips-el AP30 DBAU1500 DBAU1550 MALTA MERAKI MTX-1 OMSAL400 RB153 WGT624V3
evbmips64-el XLSATX
evbppc EV64260 MPC8536DS MPC8548CDS OPENBLOCKS200 OPENBLOCKS266
	OPENBLOCKS266_OPT P2020RDB PMPPC RB800 WALNUT
hp700 GENERIC
i386 ALL XEN3_DOM0 XEN3_DOMU
ibmnws GENERIC
macppc GENERIC
mvmeppc GENERIC
netwinder GENERIC
ofppc GENERIC
prep GENERIC
sandpoint GENERIC
sgimips GENERIC32_IP2x
sparc GENERIC_SUN4U KRUPS
sparc64 GENERIC

As of Sun Apr 3 15:26:26 CDT 2011, I could not compile these kernels
with or without my patches in place:

### evbmips-el GDIUM

nbmake: nbmake: don't know how to make /home/dyoung/pristine-nbsd/src/sys/arch/mips/mips/softintr.c. Stop

### evbarm-el MPCSA_GENERIC
src/sys/arch/evbarm/conf/MPCSA_GENERIC:318: ds1672rtc*: unknown device `ds1672rtc'

### ia64 GENERIC

/tmp/genassym.28085/assym.c: In function 'f111':
/tmp/genassym.28085/assym.c:67: error: invalid application of 'sizeof' to incomplete type 'struct pcb'
/tmp/genassym.28085/assym.c:76: error: dereferencing pointer to incomplete type

### sgimips GENERIC32_IP3x

crmfb.o: In function `crmfb_attach':
crmfb.c:(.text+0x2304): undefined reference to `ddc_read_edid'
crmfb.c:(.text+0x2304): relocation truncated to fit: R_MIPS_26 against `ddc_read_edid'
crmfb.c:(.text+0x234c): undefined reference to `edid_parse'
crmfb.c:(.text+0x234c): relocation truncated to fit: R_MIPS_26 against `edid_parse'
crmfb.c:(.text+0x2354): undefined reference to `edid_print'
crmfb.c:(.text+0x2354): relocation truncated to fit: R_MIPS_26 against `edid_print'
2011-04-04 20:37:49 +00:00
dyoung
062b6658ec Fix target 'tags'. 2011-04-04 19:44:16 +00:00
phx
58b980c294 Add more known I2C devices:
dlink: strtc
qnap: s390rtc
2011-04-04 18:01:08 +00:00
phx
0eb0c32106 Make sure a frame is at least 60 bytes, as Realtek does not automatically
expand small frames.
Patch suggested by nisimura@.
2011-04-04 16:41:34 +00:00
nisimura
fa8f20f0f2 Build and use "i2c-child-devices" property to choose the correct RTC
chip among various models.
2011-03-31 02:32:35 +00:00
phx
0e41517647 Fixed PHY access.
Support 8169SC/8110SC (as found on QNAP V200 boards).
Make frame receiving work (FRAMELEN <-> FRAMESIZE).
Driver works now, but not the first time after cold start.
2011-03-27 19:09:43 +00:00