OpenBIOS
Threads by month
- ----- 2026 -----
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1994 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1993 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1992 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1991 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1990 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1989 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1988 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1987 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1986 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1985 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1984 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1983 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1982 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1981 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1980 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1979 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1978 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1977 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1976 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1975 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1974 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1973 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1972 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1971 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1970 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1969 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1968 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1967 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1966 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1965 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1964 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1963 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1962 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1961 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1960 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1959 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1958 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1957 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1956 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1955 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1954 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1953 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1952 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1951 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1950 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1949 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1948 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1947 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1946 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1945 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1944 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1943 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1942 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1941 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1940 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1939 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1938 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1937 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1936 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1935 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1934 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1933 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1932 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1931 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1930 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1929 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1928 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1927 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1926 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1925 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1924 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1923 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1922 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1921 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1920 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1919 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1918 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1917 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1916 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1915 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1914 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1913 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1912 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1911 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1910 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1909 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1908 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1907 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1906 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1905 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1904 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
December 2008
- 8 participants
- 78 discussions
On Wed, Dec 31, 2008 at 11:05:10PM +0200, Blue Swirl wrote:
> On 12/31/08, Aurelien Jarno <aurelien(a)aurel32.net> wrote:
> > On Wed, Dec 31, 2008 at 08:00:18PM +0200, Blue Swirl wrote:
> > > On 12/31/08, Aurelien Jarno <aurelien(a)aurel32.net> wrote:
> > > > On Wed, Dec 31, 2008 at 05:24:13PM +0200, Blue Swirl wrote:
> > > > > On 12/31/08, Aurelien Jarno <aurelien(a)aurel32.net> wrote:
> > > > > > This patch adds a native configuration for PPC. It is based on the cross
> > > > > > configuration files
> > > > > >
> > > > > > Signed-off-by: Aurelien Jarno <aurelien(a)aurel32.net>
> > > > >
> > > > > > <!-- Build hosted UNIX Binary -->
> > > > > > - <option name="CONFIG_HOST_UNIX" type="boolean" value="true"/>
> > > > > > + <option name="CONFIG_HOST_UNIX" type="boolean" value="false"/>
> > > > >
> > > > > When compiling natively, we can build a Unix host version too. Is it
> > > > > OK if I commit the patch including your sign-off with this change
> > > > > removed?
> > > > >
> > > >
> > > >
> > > > Yes, I have seen that, but the Unix host version is currently not
> > > > building. I think we can enable it when it is fixed.
> > >
> > > Oh, what's the problem?
> >
> >
> > obj-ppc/libbootstrap.a(primitives.o): In function `iocfetch':
> > primitives.c:(.text+0x1416): undefined reference to `isa_io_base'
> > primitives.c:(.text+0x141e): undefined reference to `isa_io_base'
> > obj-ppc/libbootstrap.a(primitives.o): In function `iowfetch':
> > primitives.c:(.text+0x1456): undefined reference to `isa_io_base'
> > primitives.c:(.text+0x145e): undefined reference to `isa_io_base'
> > obj-ppc/libbootstrap.a(primitives.o): In function `iolfetch':
> > primitives.c:(.text+0x148a): undefined reference to `isa_io_base'
> > obj-ppc/libbootstrap.a(primitives.o):primitives.c:(.text+0x1492): more undefined references to `isa_io_base' follow
> > collect2: ld returned 1 exit status
> > make[1]: *** [obj-ppc/openbios-unix] Erreur 1
>
> The in/out functions reference isa_io_base, defined in include/ppc/io.h.
>
> Would this patch fix the build?
Yes, it fixes it. Thanks.
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32(a)debian.org | aurelien(a)aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
1
0
Author: blueswirl
Date: 2008-12-31 21:07:10 +0100 (Wed, 31 Dec 2008)
New Revision: 338
Modified:
openbios-devel/arch/sparc64/openbios.c
Log:
Suppress useless printing of kernel address and size
Modified: openbios-devel/arch/sparc64/openbios.c
===================================================================
--- openbios-devel/arch/sparc64/openbios.c 2008-12-31 18:49:53 UTC (rev 337)
+++ openbios-devel/arch/sparc64/openbios.c 2008-12-31 20:07:10 UTC (rev 338)
@@ -672,7 +672,8 @@
cmdline_size = size;
boot_device = nv_info.boot_devices[0];
- printk("kernel addr %llx size %llx\n", kernel_image, kernel_size);
+ if (kernel_size)
+ printk("kernel addr %llx size %llx\n", kernel_image, kernel_size);
if (size)
printk("kernel cmdline %s\n", obio_cmdline);
1
0
Author: blueswirl
Date: 2008-12-31 19:49:53 +0100 (Wed, 31 Dec 2008)
New Revision: 337
Added:
openbios-devel/config/examples/ppc_rules.xml
Log:
Actually add the rules file
Added: openbios-devel/config/examples/ppc_rules.xml
===================================================================
--- openbios-devel/config/examples/ppc_rules.xml (rev 0)
+++ openbios-devel/config/examples/ppc_rules.xml 2008-12-31 18:49:53 UTC (rev 337)
@@ -0,0 +1,100 @@
+<rules>
+
+<pre><![CDATA[
+#
+# Autogenerated OpenBIOS Makefile
+# (C) 2004-2005 by the OpenBIOS team
+#
+
+ARCH := ppc
+ODIR := obj-$(ARCH)
+HOSTCC := gcc
+HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
+HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
+HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
+HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
+#
+# MOLPATH is needed if you want to build openbios-mol.elf
+#
+MOLPATH=$(HOME)/mol-0.9.71
+
+CC := gcc
+AS := as
+AR := ar
+LD := ld
+NM := nm
+STRIP := strip
+RANLIB := ranlib
+CFLAGS := -Os -Wall -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2
+CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
+CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
+INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
+
+M4 := m4
+
+#
+# pre rules
+#
+
+all: mol versions dictionaries host-libraries target-libraries host-executables target-executables
+
+VERSION := "1.0RC1"
+
+versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
+
+$(ODIR)/forth/version.fs:
+ @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
+ ( echo ": builddate \" $$DATE\" ; " ; \
+ echo ": version \" $(VERSION)\" ; " ; ) \
+ > $(dir $(a))/version.fs
+
+$(ODIR)/target/include/openbios-version.h:
+ @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
+ ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
+ echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; \
+ echo "#define OPENBIOS_RELEASE \"$(VERSION)\"" ; ) \
+ > $(dir $(a))/openbios-version.h
+mol:
+ @grep CONFIG_MOL $(ODIR)/forth/config.fs >/dev/null && ( \
+ echo "Using MOL path $(MOLPATH)..."; \
+ ln -s $(MOLPATH)/src/shared/osi_calls.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/shared/osi.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/shared/prom.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/boothelper_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/video_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/pseudofs_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/kbd_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/drivers/disk/include/scsi_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/drivers/disk/include/ablk_sh.h $(ODIR)/target/include/ ) || true
+
+]]></pre>
+
+ <!-- host compiler build rules -->
+
+<rule target="host" entity="executable">
+ $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
+</rule>
+
+<rule target="host" entity="object">
+ $(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $^
+</rule>
+
+<rule target="host" entity="library">
+ $(AR) cru $@ $^; ranlib $@
+</rule>
+
+ <!-- target/cross compiler build rules -->
+
+<rule target="target" entity="executable">
+ $(CC) $(CFLAGS) -o $@ $^
+</rule>
+
+<rule target="target" entity="object">
+ $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^
+</rule>
+
+<rule target="target" entity="library">
+ $(AR) cru $@ $^; $(RANLIB) $@
+</rule>
+
+</rules>
1
0
This patch adds a native configuration for PPC. It is based on the cross
configuration files
Signed-off-by: Aurelien Jarno <aurelien(a)aurel32.net>
diff --git a/config/examples/ppc_config.xml b/config/examples/ppc_config.xml
index 4023cb8..3346357 100644
--- a/config/examples/ppc_config.xml
+++ b/config/examples/ppc_config.xml
@@ -4,19 +4,20 @@
<!-- generic -->
<!--<option name="CONFIG_AMD64" type="boolean" value="true"/> -->
<option name="CONFIG_PPC" type="boolean" value="true"/>
- <!--<option name="CONFIG_MOL" type="boolean" value="true"/>-->
- <!--<option name="CONFIG_BRIQ" type="boolean" value="true"/>-->
- <option name="CONFIG_PEARPC" type="boolean" value="true"/>
+ <option name="CONFIG_MOL" type="boolean" value="false"/>
+ <option name="CONFIG_BRIQ" type="boolean" value="false"/>
+ <option name="CONFIG_PEARPC" type="boolean" value="false"/>
+ <option name="CONFIG_QEMU" type="boolean" value="true"/>
<option name="CONFIG_BIG_ENDIAN" type="boolean" value="true"/>
<!-- Build hosted UNIX Binary -->
- <option name="CONFIG_HOST_UNIX" type="boolean" value="true"/>
+ <option name="CONFIG_HOST_UNIX" type="boolean" value="false"/>
<option name="CONFIG_UNIX_QT" type="boolean" value="false"/>
<option name="CONFIG_PLUGINS" type="boolean" value="false"/>
-
+
<!-- Kernel Debugging -->
<option name="CONFIG_DEBUG" type="boolean" value="true"/>
- <option name="CONFIG_DEBUG_BOOT" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_BOOT" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_DSTACK" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_RSTACK" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_DICTIONARY" type="boolean" value="false"/>
@@ -24,47 +25,53 @@
<option name="CONFIG_DEBUG_INTERPRETER" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_CONSOLE" type="boolean" value="true"/>
<option name="CONFIG_DEBUG_CONSOLE_SERIAL" type="boolean" value="true"/>
- <option name="CONFIG_SERIAL_PORT" type="boolean" value="true"/>
+ <option name="CONFIG_SERIAL_PORT" type="integer" value="1"/>
<option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/>
<option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/>
-
-
+
+
<!-- Module Configuration -->
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
<option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
-
-
+
+
<!-- Filesystem Configuration -->
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
<option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>
+ <option name="CONFIG_MAC_PARTS" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_MAC_PARTS" type="boolean" value="false"/>
<option name="CONFIG_PC_PARTS" type="boolean" value="true"/>
<option name="CONFIG_FS" type="boolean" value="true"/>
- <option name="CONFIG_HFS" type="boolean" value="false"/>
- <option name="CONFIG_HFSP" type="boolean" value="true"/>
+ <option name="CONFIG_HFS" type="boolean" value="true"/>
+ <option name="CONFIG_HFSP" type="boolean" value="false"/>
<option name="CONFIG_GRUBFS" type="boolean" value="true"/>
- <option name="CONFIG_FSYS_EXT2FS" type="boolean" value="false"/>
+ <option name="CONFIG_FSYS_EXT2FS" type="boolean" value="true"/>
<option name="CONFIG_FSYS_FAT" type="boolean" value="false"/>
<option name="CONFIG_FSYS_JFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_MINIX" type="boolean" value="false"/>
- <option name="CONFIG_FSYS_REISERFS" type="boolean" value="true"/>
+ <option name="CONFIG_FSYS_REISERFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_XFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_UFS" type="boolean" value="false"/>
- <option name="CONFIG_FSYS_ISO9660" type="boolean" value="false"/>
+ <option name="CONFIG_FSYS_ISO9660" type="boolean" value="true"/>
<option name="CONFIG_FSYS_FFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_VSTAFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_NTFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_AFFS" type="boolean" value="false"/>
- <option name="CONFIG_DEBUG_FS" type="boolean" value="true"/>
-
+ <option name="CONFIG_DEBUG_FS" type="boolean" value="false"/>
+
<!-- Miscellaneous -->
- <option name="CONFIG_LINUXBIOS" type="boolean" value="true"/>
-
+ <option name="CONFIG_LINUXBIOS" type="boolean" value="false"/>
+
<!-- Drivers -->
<option name="CONFIG_DRIVER_PCI" type="boolean" value="true"/>
<option name="CONFIG_DEBUG_PCI" type="boolean" value="true"/>
<option name="CONFIG_DRIVER_IDE" type="boolean" value="true"/>
- <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/>
+ <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="2"/>
+ <option name="CONFIG_IDE_FIRST_UNIT" type="integer" value="1"/>
+ <option name="CONFIG_IDE_DEV_NAME" type="string" value="ata-%d"/>
+ <option name="CONFIG_IDE_DEV_TYPE" type="string" value="ata"/>
<option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_ADB" type="boolean" value="true"/>
+ <option name="CONFIG_DRIVER_VGA" type="boolean" value="true"/>
</config>
diff --git a/config/examples/ppc_rules.xml b/config/examples/ppc_rules.xml
new file mode 100644
index 0000000..57f1479
--- /dev/null
+++ b/config/examples/ppc_rules.xml
@@ -0,0 +1,100 @@
+<rules>
+
+<pre><![CDATA[
+#
+# Autogenerated OpenBIOS Makefile
+# (C) 2004-2005 by the OpenBIOS team
+#
+
+ARCH := ppc
+ODIR := obj-$(ARCH)
+HOSTCC := gcc
+HOSTCFLAGS := -Os -Wall -W -DFCOMPILER -DBOOTSTRAP $(CROSSCFLAGS)
+HOSTCFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
+HOSTCFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
+HOSTINCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
+#
+# MOLPATH is needed if you want to build openbios-mol.elf
+#
+MOLPATH=$(HOME)/mol-0.9.71
+
+CC := gcc
+AS := as
+AR := ar
+LD := ld
+NM := nm
+STRIP := strip
+RANLIB := ranlib
+CFLAGS := -Os -Wall -msoft-float -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH -USWAP_ENDIANNESS -fno-builtin-bcopy -fno-builtin-log2
+CFLAGS+= -Wredundant-decls -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations
+CFLAGS+= -Wundef -Wendif-labels -Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
+INCLUDES := -Iinclude -Ikernel/include -I$(ODIR)/target/include
+
+M4 := m4
+
+#
+# pre rules
+#
+
+all: mol versions dictionaries host-libraries target-libraries host-executables target-executables
+
+VERSION := "1.0RC1"
+
+versions: $(ODIR)/target/include/openbios-version.h $(ODIR)/forth/version.fs
+
+$(ODIR)/forth/version.fs:
+ @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
+ ( echo ": builddate \" $$DATE\" ; " ; \
+ echo ": version \" $(VERSION)\" ; " ; ) \
+ > $(dir $(a))/version.fs
+
+$(ODIR)/target/include/openbios-version.h:
+ @DATE="$(shell echo `LC_ALL=C TZ=UTC date +'%b %e %Y %H:%M'`)" ; \
+ ( echo "#define OPENBIOS_BUILD_DATE \"$$DATE\"" ; \
+ echo "#define OPENBIOS_VERSION_STR \"$(VERSION)\"" ; \
+ echo "#define OPENBIOS_RELEASE \"$(VERSION)\"" ; ) \
+ > $(dir $(a))/openbios-version.h
+mol:
+ @grep CONFIG_MOL $(ODIR)/forth/config.fs >/dev/null && ( \
+ echo "Using MOL path $(MOLPATH)..."; \
+ ln -s $(MOLPATH)/src/shared/osi_calls.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/shared/osi.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/shared/prom.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/boothelper_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/video_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/pseudofs_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/include/kbd_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/drivers/disk/include/scsi_sh.h $(ODIR)/target/include/; \
+ ln -s $(MOLPATH)/src/drivers/disk/include/ablk_sh.h $(ODIR)/target/include/ ) || true
+
+]]></pre>
+
+ <!-- host compiler build rules -->
+
+<rule target="host" entity="executable">
+ $(HOSTCC) $(HOSTCFLAGS) -o $@ $^
+</rule>
+
+<rule target="host" entity="object">
+ $(HOSTCC) $(HOSTCFLAGS) $(HOSTINCLUDES) -c -o $@ $^
+</rule>
+
+<rule target="host" entity="library">
+ $(AR) cru $@ $^; ranlib $@
+</rule>
+
+ <!-- target/cross compiler build rules -->
+
+<rule target="target" entity="executable">
+ $(CC) $(CFLAGS) -o $@ $^
+</rule>
+
+<rule target="target" entity="object">
+ $(CC) $$EXTRACFLAGS $(CFLAGS) $(INCLUDES) -c -o $@ $^
+</rule>
+
+<rule target="target" entity="library">
+ $(AR) cru $@ $^; $(RANLIB) $@
+</rule>
+
+</rules>
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32(a)debian.org | aurelien(a)aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
2
4
Author: blueswirl
Date: 2008-12-31 19:16:01 +0100 (Wed, 31 Dec 2008)
New Revision: 336
Modified:
openbios-devel/config/examples/cross-sparc32_config.xml
openbios-devel/config/examples/cross-sparc64_config.xml
openbios-devel/config/examples/sparc32_config.xml
openbios-devel/config/examples/sparc64_config.xml
openbios-devel/config/examples/x86_config.xml
openbios-devel/drivers/floppy.c
Log:
Suppress floppy debug and info messages by default
Modified: openbios-devel/config/examples/cross-sparc32_config.xml
===================================================================
--- openbios-devel/config/examples/cross-sparc32_config.xml 2008-12-31 18:01:53 UTC (rev 335)
+++ openbios-devel/config/examples/cross-sparc32_config.xml 2008-12-31 18:16:01 UTC (rev 336)
@@ -72,5 +72,6 @@
<option name="CONFIG_DRIVER_OBIO" type="boolean" value="true"/>
<option name="CONFIG_DRIVER_ESP" type="boolean" value="true"/>
<option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/>
</config>
Modified: openbios-devel/config/examples/cross-sparc64_config.xml
===================================================================
--- openbios-devel/config/examples/cross-sparc64_config.xml 2008-12-31 18:01:53 UTC (rev 335)
+++ openbios-devel/config/examples/cross-sparc64_config.xml 2008-12-31 18:16:01 UTC (rev 336)
@@ -71,6 +71,7 @@
<option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/>
<option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_VGA" type="boolean" value="true"/>
</config>
Modified: openbios-devel/config/examples/sparc32_config.xml
===================================================================
--- openbios-devel/config/examples/sparc32_config.xml 2008-12-31 18:01:53 UTC (rev 335)
+++ openbios-devel/config/examples/sparc32_config.xml 2008-12-31 18:16:01 UTC (rev 336)
@@ -72,5 +72,6 @@
<option name="CONFIG_DRIVER_OBIO" type="boolean" value="true"/>
<option name="CONFIG_DRIVER_ESP" type="boolean" value="true"/>
<option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/>
</config>
Modified: openbios-devel/config/examples/sparc64_config.xml
===================================================================
--- openbios-devel/config/examples/sparc64_config.xml 2008-12-31 18:01:53 UTC (rev 335)
+++ openbios-devel/config/examples/sparc64_config.xml 2008-12-31 18:16:01 UTC (rev 336)
@@ -71,6 +71,7 @@
<option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/>
<option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_VGA" type="boolean" value="true"/>
</config>
Modified: openbios-devel/config/examples/x86_config.xml
===================================================================
--- openbios-devel/config/examples/x86_config.xml 2008-12-31 18:01:53 UTC (rev 335)
+++ openbios-devel/config/examples/x86_config.xml 2008-12-31 18:16:01 UTC (rev 336)
@@ -69,5 +69,6 @@
<option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/>
<option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_FLOPPY" type="boolean" value="false"/>
+ <option name="CONFIG_DEBUG_FLOPPY" type="boolean" value="false"/>
</config>
Modified: openbios-devel/drivers/floppy.c
===================================================================
--- openbios-devel/drivers/floppy.c 2008-12-31 18:01:53 UTC (rev 335)
+++ openbios-devel/drivers/floppy.c 2008-12-31 18:16:01 UTC (rev 336)
@@ -11,8 +11,13 @@
/* DECLARE data structures for the nodes. */
DECLARE_UNNAMED_NODE( ob_floppy, INSTALL_OPEN, 2*sizeof(int) );
+#ifdef CONFIG_DEBUG_FLOPPY
#define printk_info printk
#define printk_debug printk
+#else
+#define printk_info(x ...)
+#define printk_debug(x ...)
+#endif
#define printk_err printk
#ifndef FD_BASE
1
0
Author: blueswirl
Date: 2008-12-31 19:01:53 +0100 (Wed, 31 Dec 2008)
New Revision: 335
Modified:
openbios-devel/config/examples/ppc_config.xml
Log:
PPC: add a native configuration
This patch adds a native configuration for PPC. It is based on the cross
configuration files
Signed-off-by: Aurelien Jarno <aurelien(a)aurel32.net>
Modified: openbios-devel/config/examples/ppc_config.xml
===================================================================
--- openbios-devel/config/examples/ppc_config.xml 2008-12-31 16:21:08 UTC (rev 334)
+++ openbios-devel/config/examples/ppc_config.xml 2008-12-31 18:01:53 UTC (rev 335)
@@ -4,19 +4,20 @@
<!-- generic -->
<!--<option name="CONFIG_AMD64" type="boolean" value="true"/> -->
<option name="CONFIG_PPC" type="boolean" value="true"/>
- <!--<option name="CONFIG_MOL" type="boolean" value="true"/>-->
- <!--<option name="CONFIG_BRIQ" type="boolean" value="true"/>-->
- <option name="CONFIG_PEARPC" type="boolean" value="true"/>
+ <option name="CONFIG_MOL" type="boolean" value="false"/>
+ <option name="CONFIG_BRIQ" type="boolean" value="false"/>
+ <option name="CONFIG_PEARPC" type="boolean" value="false"/>
+ <option name="CONFIG_QEMU" type="boolean" value="true"/>
<option name="CONFIG_BIG_ENDIAN" type="boolean" value="true"/>
<!-- Build hosted UNIX Binary -->
- <option name="CONFIG_HOST_UNIX" type="boolean" value="true"/>
+ <option name="CONFIG_HOST_UNIX" type="boolean" value="false"/>
<option name="CONFIG_UNIX_QT" type="boolean" value="false"/>
<option name="CONFIG_PLUGINS" type="boolean" value="false"/>
-
+
<!-- Kernel Debugging -->
<option name="CONFIG_DEBUG" type="boolean" value="true"/>
- <option name="CONFIG_DEBUG_BOOT" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_BOOT" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_DSTACK" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_RSTACK" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_DICTIONARY" type="boolean" value="false"/>
@@ -24,47 +25,53 @@
<option name="CONFIG_DEBUG_INTERPRETER" type="boolean" value="false"/>
<option name="CONFIG_DEBUG_CONSOLE" type="boolean" value="true"/>
<option name="CONFIG_DEBUG_CONSOLE_SERIAL" type="boolean" value="true"/>
- <option name="CONFIG_SERIAL_PORT" type="boolean" value="true"/>
+ <option name="CONFIG_SERIAL_PORT" type="integer" value="1"/>
<option name="CONFIG_SERIAL_SPEED" type="integer" value="115200"/>
<option name="CONFIG_DEBUG_CONSOLE_VGA" type="boolean" value="true"/>
-
-
+
+
<!-- Module Configuration -->
<option name="CONFIG_CMDLINE" type="boolean" value="true"/>
<option name="CONFIG_DEBLOCKER" type="boolean" value="true"/>
-
-
+
+
<!-- Filesystem Configuration -->
<option name="CONFIG_DISK_LABEL" type="boolean" value="true"/>
<option name="CONFIG_PART_SUPPORT" type="boolean" value="true"/>
+ <option name="CONFIG_MAC_PARTS" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_MAC_PARTS" type="boolean" value="false"/>
<option name="CONFIG_PC_PARTS" type="boolean" value="true"/>
<option name="CONFIG_FS" type="boolean" value="true"/>
- <option name="CONFIG_HFS" type="boolean" value="false"/>
- <option name="CONFIG_HFSP" type="boolean" value="true"/>
+ <option name="CONFIG_HFS" type="boolean" value="true"/>
+ <option name="CONFIG_HFSP" type="boolean" value="false"/>
<option name="CONFIG_GRUBFS" type="boolean" value="true"/>
- <option name="CONFIG_FSYS_EXT2FS" type="boolean" value="false"/>
+ <option name="CONFIG_FSYS_EXT2FS" type="boolean" value="true"/>
<option name="CONFIG_FSYS_FAT" type="boolean" value="false"/>
<option name="CONFIG_FSYS_JFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_MINIX" type="boolean" value="false"/>
- <option name="CONFIG_FSYS_REISERFS" type="boolean" value="true"/>
+ <option name="CONFIG_FSYS_REISERFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_XFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_UFS" type="boolean" value="false"/>
- <option name="CONFIG_FSYS_ISO9660" type="boolean" value="false"/>
+ <option name="CONFIG_FSYS_ISO9660" type="boolean" value="true"/>
<option name="CONFIG_FSYS_FFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_VSTAFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_NTFS" type="boolean" value="false"/>
<option name="CONFIG_FSYS_AFFS" type="boolean" value="false"/>
- <option name="CONFIG_DEBUG_FS" type="boolean" value="true"/>
-
+ <option name="CONFIG_DEBUG_FS" type="boolean" value="false"/>
+
<!-- Miscellaneous -->
- <option name="CONFIG_LINUXBIOS" type="boolean" value="true"/>
-
+ <option name="CONFIG_LINUXBIOS" type="boolean" value="false"/>
+
<!-- Drivers -->
<option name="CONFIG_DRIVER_PCI" type="boolean" value="true"/>
<option name="CONFIG_DEBUG_PCI" type="boolean" value="true"/>
<option name="CONFIG_DRIVER_IDE" type="boolean" value="true"/>
- <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="4"/>
+ <option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="2"/>
+ <option name="CONFIG_IDE_FIRST_UNIT" type="integer" value="1"/>
+ <option name="CONFIG_IDE_DEV_NAME" type="string" value="ata-%d"/>
+ <option name="CONFIG_IDE_DEV_TYPE" type="string" value="ata"/>
<option name="CONFIG_DEBUG_IDE" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_ADB" type="boolean" value="true"/>
+ <option name="CONFIG_DRIVER_VGA" type="boolean" value="true"/>
</config>
1
0
Author: blueswirl
Date: 2008-12-31 17:21:08 +0100 (Wed, 31 Dec 2008)
New Revision: 334
Added:
openbios-devel/drivers/pci_database.c
openbios-devel/drivers/pci_database.h
Modified:
openbios-devel/drivers/build.xml
openbios-devel/drivers/pci.c
Log:
Move PCI database part from pci.c to its own file pci_database.c
(Laurent Vivier)
Modified: openbios-devel/drivers/build.xml
===================================================================
--- openbios-devel/drivers/build.xml 2008-12-31 16:19:15 UTC (rev 333)
+++ openbios-devel/drivers/build.xml 2008-12-31 16:21:08 UTC (rev 334)
@@ -2,6 +2,7 @@
<library name="drivers" type="static" target="target">
<object source="pci.c" condition="DRIVER_PCI"/>
+ <object source="pci_database.c" condition="DRIVER_PCI"/>
<object source="ide.c" condition="DRIVER_IDE"/>
<object source="timer.c" condition="DRIVER_IDE"/>
<object source="kbd.c" condition="DRIVER_ADB"/>
Modified: openbios-devel/drivers/pci.c
===================================================================
--- openbios-devel/drivers/pci.c 2008-12-31 16:19:15 UTC (rev 333)
+++ openbios-devel/drivers/pci.c 2008-12-31 16:21:08 UTC (rev 334)
@@ -26,11 +26,13 @@
#include "video_subr.h"
#include "timer.h"
#include "pci.h"
+#include "pci_database.h"
#include "cuda.h"
#define set_bool_property(ph, name) set_property(ph, name, NULL, 0);
/* DECLARE data structures for the nodes. */
+
DECLARE_UNNAMED_NODE( ob_pci_node, INSTALL_OPEN, 2*sizeof(int) );
const pci_arch_t *arch;
@@ -60,96 +62,7 @@
{ "close", ob_pci_close },
};
-/* PCI devices database */
-typedef struct pci_class_t pci_class_t;
-typedef struct pci_subclass_t pci_subclass_t;
-typedef struct pci_iface_t pci_iface_t;
-typedef struct pci_dev_t pci_dev_t;
-
-typedef struct pci_config_t pci_config_t;
-
-struct pci_config_t {
- char path[64];
- uint32_t regions[7];
- uint32_t sizes[7];
-};
-
-struct pci_iface_t {
- uint8_t iface;
- const char *name;
- const char *type;
- const pci_dev_t *devices;
- int (*config_cb)(const pci_config_t *config);
- const void *private;
-};
-
-struct pci_subclass_t {
- uint8_t subclass;
- const char *name;
- const char *type;
- const pci_dev_t *devices;
- const pci_iface_t *iface;
- int (*config_cb)(const pci_config_t *config);
- const void *private;
-};
-
-struct pci_class_t {
- const char *name;
- const char *type;
- const pci_subclass_t *subc;
-};
-
-struct pci_dev_t {
- uint16_t vendor;
- uint16_t product;
- const char *type;
- const char *name;
- const char *model;
- const char *compat;
- int acells;
- int scells;
- int icells;
- int (*config_cb)(const pci_config_t *config);
- const void *private;
-};
-
-/* Current machine description */
-
-typedef struct pci_bridge_t pci_bridge_t;
-
-/* Low level access helpers */
-struct pci_ops_t {
- uint8_t (*config_readb)(pci_bridge_t *bridge,
- uint8_t bus, uint8_t devfn, uint8_t offset);
- void (*config_writeb)(pci_bridge_t *bridge,
- uint8_t bus, uint8_t devfn,
- uint8_t offset, uint8_t val);
- uint16_t (*config_readw)(pci_bridge_t *bridge,
- uint8_t bus, uint8_t devfn, uint8_t offset);
- void (*config_writew)(pci_bridge_t *bridge,
- uint8_t bus, uint8_t devfn,
- uint8_t offset, uint16_t val);
- uint32_t (*config_readl)(pci_bridge_t *bridge,
- uint8_t bus, uint8_t devfn, uint8_t offset);
- void (*config_writel)(pci_bridge_t *bridge,
- uint8_t bus, uint8_t devfn,
- uint8_t offset, uint32_t val);
-};
-
-static const pci_subclass_t undef_subclass[] = {
-#if 0
- {
- 0x00, "misc undefined", NULL, NULL, NULL,
- NULL, NULL,
- },
-#endif
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static int ide_config_cb2 (const pci_config_t *config)
+int ide_config_cb2 (const pci_config_t *config)
{
ob_ide_init(config->path,
config->regions[0] & ~0x0000000F,
@@ -159,71 +72,7 @@
return 0;
}
-static const pci_dev_t ide_devices[] = {
- {
- 0x1095, 0x0646, /* CMD646 IDE controller */
- "pci-ide", "pci-ata", NULL, NULL,
- 0, 0, 0,
- ide_config_cb2, NULL,
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t mass_subclass[] = {
- {
- 0x00, "SCSI bus controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "IDE controller", "ide", ide_devices, NULL,
- NULL, NULL,
- },
- {
- 0x02, "Floppy disk controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "IPI bus controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x04, "RAID controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x05, "ATA controller", "ata", NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc mass-storage controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_dev_t eth_devices[] = {
- { 0x10EC, 0x8029,
- NULL, "NE2000", "NE2000 PCI", NULL,
- 0, 0, 0,
- NULL, "ethernet",
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-static int eth_config_cb (const pci_config_t *config)
+int eth_config_cb (const pci_config_t *config)
{
phandle_t ph;
cell props[12];
@@ -244,856 +93,8 @@
return 0;
}
-static const pci_subclass_t net_subclass[] = {
- {
- 0x00, "ethernet controller", NULL, eth_devices, NULL,
- eth_config_cb, "ethernet",
- },
- {
- 0x01, "token ring controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "FDDI controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "ATM controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x04, "ISDN controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x05, "WordFip controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x06, "PICMG 2.14 controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc network controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_dev_t vga_devices[] = {
- {
- 0x1002, 0x5046,
- NULL, "ATY", "ATY Rage128", "VGA",
- 0, 0, 0,
- NULL, NULL,
- },
- {
- 0x1234, 0x1111,
- NULL, "QEMU,VGA", "Qemu VGA", "VGA",
- 0, 0, 0,
- NULL, NULL,
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-/* VGA configuration */
-
-static int vga_config_cb (const pci_config_t *config)
-{
- if (config->regions[0] != 0x00000000)
- vga_vbe_init(config->path, config->regions[0], config->sizes[0],
- config->regions[1], config->sizes[1]);
- return 0;
-}
-
-static const struct pci_iface_t vga_iface[] = {
- {
- 0x00, "VGA controller", NULL,
- vga_devices, &vga_config_cb, NULL,
- },
- {
- 0x01, "8514 compatible controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_subclass_t displ_subclass[] = {
- {
- 0x00, "display controller", NULL, NULL, vga_iface,
- NULL, NULL,
- },
- {
- 0x01, "XGA display controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "3D display controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc display controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t media_subclass[] = {
- {
- 0x00, "video device", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "audio device", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "computer telephony device", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc multimedia device", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t mem_subclass[] = {
- {
- 0x00, "RAM controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "flash controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_dev_t grackle_fake_bridge = {
- 0xFFFF, 0xFFFF,
- "pci", "pci-bridge", "DEC,21154", "DEC,21154.pci-bridge",
- -1, -1, -1,
- NULL, NULL,
-};
-
-static const pci_dev_t uninorth_agp_fake_bridge = {
- 0xFFFF, 0xFFFF,
- "uni-north-agp", "uni-north-agp", NULL, "uni-north-agp",
- -1, -1, -1,
- NULL, NULL,
-};
-
-static const pci_dev_t uninorth_fake_bridge = {
- 0xFFFF, 0xFFFF,
- "uni-north", "uni-north", NULL, "uni-north",
- -1, -1, -1,
- NULL, NULL,
-};
-
-
-static const pci_dev_t hbrg_devices[] = {
- {
- 0x106B, 0x0020, NULL,
- "pci", "AAPL,UniNorth", "uni-north",
- 3, 2, 1,
- NULL, &uninorth_agp_fake_bridge,
- },
- {
- 0x106B, 0x001F, NULL,
- "pci", "AAPL,UniNorth", "uni-north",
- 3, 2, 1,
- NULL, &uninorth_fake_bridge,
- },
- {
- 0x106B, 0x001E, NULL,
- "pci", "AAPL,UniNorth", "uni-north",
- 3, 2, 1,
- NULL, &uninorth_fake_bridge,
- },
- {
- 0x1057, 0x0002, "pci",
- "pci", "MOT,MPC106", "grackle",
- 3, 2, 1,
- NULL, &grackle_fake_bridge,
- },
- {
- 0x1057, 0x4801, NULL,
- "pci-bridge", "PREP Host PCI Bridge - Motorola Raven", NULL,
- 3, 2, 1,
- NULL, NULL,
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-static const pci_dev_t PCIbrg_devices[] = {
- {
- 0x1011, 0x0026, NULL,
- "pci-bridge", NULL, NULL,
- 3, 2, 1,
- NULL, NULL,
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t bridg_subclass[] = {
- {
- 0x00, "PCI host bridge", NULL, hbrg_devices, NULL,
- NULL, NULL,
- },
- {
- 0x01, "ISA bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "EISA bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "MCA bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x04, "PCI-to-PCI bridge", NULL, PCIbrg_devices, NULL,
- NULL, NULL,
- },
- {
- 0x05, "PCMCIA bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x06, "NUBUS bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x07, "cardbus bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x08, "raceway bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x09, "semi-transparent PCI-to-PCI bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x0A, "infiniband-to-PCI bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc PCI bridge", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_iface_t serial_iface[] = {
- {
- 0x00, "XT serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "16450 serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "16550 serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x03, "16650 serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x04, "16750 serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x05, "16850 serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x06, "16950 serial controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_iface_t par_iface[] = {
- {
- 0x00, "parallel port", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "bi-directional parallel port", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "ECP 1.x parallel port", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x03, "IEEE 1284 controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFE, "IEEE 1284 device", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_iface_t modem_iface[] = {
- {
- 0x00, "generic modem", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "Hayes 16450 modem", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "Hayes 16550 modem", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x03, "Hayes 16650 modem", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x04, "Hayes 16750 modem", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_subclass_t comm_subclass[] = {
- {
- 0x00, "serial controller", NULL, NULL, serial_iface,
- NULL, NULL,
- },
- {
- 0x01, "parallel port", NULL, NULL, par_iface,
- NULL, NULL,
- },
- {
- 0x02, "multiport serial controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "modem", NULL, NULL, modem_iface,
- NULL, NULL,
- },
- {
- 0x04, "GPIB controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x05, "smart card", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc communication device", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_iface_t pic_iface[] = {
- {
- 0x00, "8259 PIC", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "ISA PIC", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "EISA PIC", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x10, "I/O APIC", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x20, "I/O APIC", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_iface_t dma_iface[] = {
- {
- 0x00, "8237 DMA controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "ISA DMA controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "EISA DMA controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_iface_t tmr_iface[] = {
- {
- 0x00, "8254 system timer", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "ISA system timer", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "EISA system timer", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_iface_t rtc_iface[] = {
- {
- 0x00, "generic RTC controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "ISA RTC controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_dev_t sys_devices[] = {
- /* IBM MPIC controller */
- {
- 0x1014, 0x0002,
- "open-pic", "MPIC", NULL, "chrp,open-pic",
- 0, 0, 2,
- NULL, NULL,
- },
- /* IBM MPIC2 controller */
- {
- 0x1014, 0xFFFF,
- "open-pic", "MPIC2", NULL, "chrp,open-pic",
- 0, 0, 2,
- NULL, NULL,
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t sys_subclass[] = {
- {
- 0x00, "PIC", NULL, NULL, pic_iface,
- NULL, NULL,
- },
- {
- 0x01, "DMA controller", NULL, NULL, dma_iface,
- NULL, NULL,
- },
- {
- 0x02, "system timer", NULL, NULL, tmr_iface,
- NULL, NULL,
- },
- {
- 0x03, "RTC controller", NULL, NULL, rtc_iface,
- NULL, NULL,
- },
- {
- 0x04, "PCI hotplug controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc system peripheral", NULL, sys_devices, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t inp_subclass[] = {
- {
- 0x00, "keyboard controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "digitizer", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "mouse controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "scanner controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x04, "gameport controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc input device", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t dock_subclass[] = {
- {
- 0x00, "generic docking station", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc docking station", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t cpu_subclass[] = {
- {
- 0x00, "i386 processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "i486 processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "pentium processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x10, "alpha processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x20, "PowerPC processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x30, "MIPS processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x40, "co-processor", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_iface_t usb_iface[] = {
- {
- 0x00, "UHCI USB controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x10, "OHCI USB controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x20, "EHCI USB controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x80, "misc USB controller", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFE, "USB device", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_iface_t ipmi_iface[] = {
- {
- 0x00, "IPMI SMIC interface", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x01, "IPMI keyboard interface", NULL,
- NULL, NULL, NULL,
- },
- {
- 0x02, "IPMI block transfer interface", NULL,
- NULL, NULL, NULL,
- },
- {
- 0xFF, NULL, NULL,
- NULL, NULL, NULL,
- },
-};
-
-static const pci_subclass_t ser_subclass[] = {
- {
- 0x00, "Firewire bus controller", "ieee1394", NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "ACCESS bus controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "SSA controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "USB controller", "usb", NULL, usb_iface,
- NULL, NULL,
- },
- {
- 0x04, "fibre channel controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x05, "SMBus controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x06, "InfiniBand controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x07, "IPMI interface", NULL, NULL, ipmi_iface,
- NULL, NULL,
- },
- {
- 0x08, "SERCOS controller", NULL, NULL, ipmi_iface,
- NULL, NULL,
- },
- {
- 0x09, "CANbus controller", NULL, NULL, ipmi_iface,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t wrl_subclass[] = {
- {
- 0x00, "IRDA controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "consumer IR controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x10, "RF controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x11, "bluetooth controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x12, "broadband controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc wireless controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t sat_subclass[] = {
- {
- 0x01, "satellite TV controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x02, "satellite audio controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x03, "satellite voice controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x04, "satellite data controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t crypt_subclass[] = {
- {
- 0x00, "cryptographic network controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x10, "cryptographic entertainment controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc cryptographic controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_subclass_t spc_subclass[] = {
- {
- 0x00, "DPIO module", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x01, "performances counters", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x10, "communication synchronisation", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x20, "management card", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0x80, "misc signal processing controller", NULL, NULL, NULL,
- NULL, NULL,
- },
- {
- 0xFF, NULL, NULL, NULL, NULL,
- NULL, NULL,
- },
-};
-
-static const pci_class_t pci_classes[] = {
- /* 0x00 */
- { "undefined", NULL, undef_subclass, },
- /* 0x01 */
- { "mass-storage controller", NULL, mass_subclass, },
- /* 0x02 */
- { "network controller", "network", net_subclass, },
- /* 0x03 */
- { "display controller", "display", displ_subclass, },
- /* 0x04 */
- { "multimedia device", NULL, media_subclass, },
- /* 0x05 */
- { "memory controller", "memory-controller", mem_subclass, },
- /* 0x06 */
- { "PCI bridge", "pci", bridg_subclass, },
- /* 0x07 */
- { "communication device", NULL, comm_subclass,},
- /* 0x08 */
- { "system peripheral", NULL, sys_subclass, },
- /* 0x09 */
- { "input device", NULL, inp_subclass, },
- /* 0x0A */
- { "docking station", NULL, dock_subclass, },
- /* 0x0B */
- { "processor", NULL, cpu_subclass, },
- /* 0x0C */
- { "serial bus controller", NULL, ser_subclass, },
- /* 0x0D */
- { "wireless controller", NULL, wrl_subclass, },
- /* 0x0E */
- { "intelligent I/O controller", NULL, NULL, },
- /* 0x0F */
- { "satellite communication controller", NULL, sat_subclass, },
- /* 0x10 */
- { "cryptographic controller", NULL, crypt_subclass, },
- /* 0x11 */
- { "signal processing controller", NULL, spc_subclass, },
-};
-
phandle_t pic_handle;
-static int macio_config_cb (const pci_config_t *config)
+int macio_config_cb (const pci_config_t *config)
{
#ifdef CONFIG_PPC
char buf[64];
@@ -1118,142 +119,14 @@
return 0;
}
-static const pci_dev_t misc_pci[] = {
- /* Paddington Mac I/O */
- {
- 0x106B, 0x0017,
- "mac-io", "mac-io", "AAPL,343S1211", "paddington\1heathrow",
- 1, 1, 1,
- &macio_config_cb, NULL,
- },
- /* KeyLargo Mac I/O */
- {
- 0x106B, 0x0022,
- "mac-io", "mac-io", "AAPL,Keylargo", "Keylargo",
- 1, 1, 2,
- &macio_config_cb, NULL,
- },
- {
- 0xFFFF, 0xFFFF,
- NULL, NULL, NULL, NULL,
- -1, -1, -1,
- NULL, NULL,
- },
-};
-
-static const pci_dev_t *pci_find_device (uint8_t class, uint8_t subclass,
- uint8_t iface, uint16_t vendor,
- uint16_t product)
+int vga_config_cb (const pci_config_t *config)
{
- int (*config_cb)(const pci_config_t *config);
- const pci_class_t *pclass;
- const pci_subclass_t *psubclass;
- const pci_iface_t *piface;
- const pci_dev_t *dev;
- const void *private;
- pci_dev_t *new;
- const char *name, *type;
-
- name = "unknown";
- type = "unknown";
- config_cb = NULL;
- private = NULL;
-
- if (class == 0x00 && subclass == 0x01) {
- /* Special hack for old style VGA devices */
- class = 0x03;
- subclass = 0x00;
- } else if (class == 0xFF) {
- /* Special case for misc devices */
- dev = misc_pci;
- goto find_device;
- }
- if (class > (sizeof(pci_classes) / sizeof(pci_class_t))) {
- name = "invalid PCI device";
- type = "invalid";
- goto bad_device;
- }
- pclass = &pci_classes[class];
- name = pclass->name;
- type = pclass->type;
- for (psubclass = pclass->subc; ; psubclass++) {
- if (psubclass->subclass == 0xFF)
- goto bad_device;
- if (psubclass->subclass == subclass) {
- if (psubclass->name != NULL)
- name = psubclass->name;
- if (psubclass->type != NULL)
- type = psubclass->type;
- if (psubclass->config_cb != NULL) {
- config_cb = psubclass->config_cb;
- }
- if (psubclass->private != NULL)
- private = psubclass->private;
- if (psubclass->iface != NULL)
- break;
- dev = psubclass->devices;
- goto find_device;
- }
- }
- for (piface = psubclass->iface; ; piface++) {
- if (piface->iface == 0xFF) {
- dev = psubclass->devices;
- break;
- }
- if (piface->iface == iface) {
- if (piface->name != NULL)
- name = piface->name;
- if (piface->type != NULL)
- type = piface->type;
- if (piface->config_cb != NULL) {
- config_cb = piface->config_cb;
- }
- if (piface->private != NULL)
- private = piface->private;
- dev = piface->devices;
- break;
- }
- }
- find_device:
- for (;; dev++) {
- if (dev->vendor == 0xFFFF && dev->product == 0xFFFF) {
- goto bad_device;
- }
- if (dev->vendor == vendor && dev->product == product) {
- if (dev->name != NULL)
- name = dev->name;
- if (dev->type != NULL)
- type = dev->type;
- if (dev->config_cb != NULL) {
- config_cb = dev->config_cb;
- }
- if (dev->private != NULL)
- private = dev->private;
- new = malloc(sizeof(pci_dev_t));
- if (new == NULL)
- return NULL;
- new->vendor = vendor;
- new->product = product;
- new->type = type;
- new->name = name;
- new->model = dev->model;
- new->compat = dev->compat;
- new->config_cb = config_cb;
- new->private = private;
-
- return new;
- }
- }
- bad_device:
- printk("Cannot manage '%s' PCI device type '%s':\n %x %x (%x %x %x)\n",
- name, type, vendor, product, class, subclass, iface);
-
- return NULL;
+ if (config->regions[0] != 0x00000000)
+ vga_vbe_init(config->path, config->regions[0], config->sizes[0],
+ config->regions[1], config->sizes[1]);
+ return 0;
}
-#define set_bool_property(ph, name) set_property(ph, name, NULL, 0);
-
-
static void ob_pci_add_properties(pci_addr addr, const pci_dev_t *pci_dev,
const pci_config_t *config)
{
@@ -1268,7 +141,6 @@
/* create properties as described in 2.5 */
- printk("%s\n", pci_dev->name);
set_int_property(dev, "vendor-id", vendor_id);
set_int_property(dev, "device-id", device_id);
set_int_property(dev, "revision-id", rev);
@@ -1529,7 +401,9 @@
int bus;
unsigned long mem_base, io_base;
+#ifdef CONFIG_DEBUG_PCI
printk("Initializing PCI devices...\n");
+#endif
/* brute force bus scan */
Added: openbios-devel/drivers/pci_database.c
===================================================================
--- openbios-devel/drivers/pci_database.c (rev 0)
+++ openbios-devel/drivers/pci_database.c 2008-12-31 16:21:08 UTC (rev 334)
@@ -0,0 +1,1063 @@
+#include "openbios/config.h"
+#include "openbios/bindings.h"
+#include "libc/vsprintf.h"
+
+#include "pci_database.h"
+
+/* PCI devices database */
+
+typedef struct pci_class_t pci_class_t;
+typedef struct pci_subclass_t pci_subclass_t;
+typedef struct pci_iface_t pci_iface_t;
+
+struct pci_iface_t {
+ uint8_t iface;
+ const char *name;
+ const char *type;
+ const pci_dev_t *devices;
+ int (*config_cb)(const pci_config_t *config);
+ const void *private;
+};
+
+struct pci_subclass_t {
+ uint8_t subclass;
+ const char *name;
+ const char *type;
+ const pci_dev_t *devices;
+ const pci_iface_t *iface;
+ int (*config_cb)(const pci_config_t *config);
+ const void *private;
+};
+
+struct pci_class_t {
+ const char *name;
+ const char *type;
+ const pci_subclass_t *subc;
+};
+
+/* Current machine description */
+
+static const pci_subclass_t undef_subclass[] = {
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_dev_t ide_devices[] = {
+ {
+ 0x1095, 0x0646, /* CMD646 IDE controller */
+ "pci-ide", "pci-ata", NULL,
+ "pci1095,646\0pci1095,646\0pciclass,01018f\0",
+ 0, 0, 0,
+ ide_config_cb2, NULL,
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t mass_subclass[] = {
+ {
+ 0x00, "SCSI bus controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "IDE controller", "ide", ide_devices, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "Floppy disk controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "IPI bus controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x04, "RAID controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x05, "ATA controller", "ata", NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc mass-storage controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_dev_t eth_devices[] = {
+ { 0x10EC, 0x8029,
+ NULL, "NE2000", "NE2000 PCI", NULL,
+ 0, 0, 0,
+ NULL, "ethernet",
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t net_subclass[] = {
+ {
+ 0x00, "ethernet controller", NULL, eth_devices, NULL,
+ eth_config_cb, "ethernet",
+ },
+ {
+ 0x01, "token ring controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "FDDI controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "ATM controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x04, "ISDN controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x05, "WordFip controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x06, "PICMG 2.14 controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc network controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_dev_t vga_devices[] = {
+ {
+ 0x1002, 0x5046,
+ NULL, "ATY", "ATY Rage128", "VGA\0",
+ 0, 0, 0,
+ NULL, NULL,
+ },
+ {
+ 0x1234, 0x1111,
+ NULL, "QEMU,VGA", "Qemu VGA", "VGA\0",
+ 0, 0, 0,
+ NULL, NULL,
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+static const struct pci_iface_t vga_iface[] = {
+ {
+ 0x00, "VGA controller", NULL,
+ vga_devices, &vga_config_cb, NULL,
+ },
+ {
+ 0x01, "8514 compatible controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_subclass_t displ_subclass[] = {
+ {
+ 0x00, "display controller", NULL, NULL, vga_iface,
+ NULL, NULL,
+ },
+ {
+ 0x01, "XGA display controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "3D display controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc display controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t media_subclass[] = {
+ {
+ 0x00, "video device", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "audio device", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "computer telephony device", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc multimedia device", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t mem_subclass[] = {
+ {
+ 0x00, "RAM controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "flash controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+
+static const pci_dev_t hbrg_devices[] = {
+ {
+ 0x106B, 0x0020, NULL,
+ "pci", "AAPL,UniNorth", "uni-north\0",
+ 3, 2, 1,
+ NULL, NULL
+ },
+ {
+ 0x106B, 0x001F, NULL,
+ "pci", "AAPL,UniNorth", "uni-north\0",
+ 3, 2, 1,
+ NULL, NULL
+ },
+ {
+ 0x106B, 0x001E, NULL,
+ "pci", "AAPL,UniNorth", "uni-north\0",
+ 3, 2, 1,
+ NULL, NULL
+ },
+ {
+ 0x1057, 0x0002, "pci",
+ "pci", "MOT,MPC106", "grackle\0",
+ 3, 2, 1,
+ NULL, NULL
+ },
+ {
+ 0x1057, 0x4801, NULL,
+ "pci-bridge", "PREP Host PCI Bridge - Motorola Raven", NULL,
+ 3, 2, 1,
+ NULL, NULL,
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+static const pci_dev_t PCIbrg_devices[] = {
+ {
+ 0x1011, 0x0026, NULL,
+ "pci-bridge", "DEV,21154", "DEV,21154\0pci-bridge\0",
+ 3, 2, 1,
+ NULL, NULL,
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t bridg_subclass[] = {
+ {
+ 0x00, "PCI host bridge", NULL, hbrg_devices, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "ISA bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "EISA bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "MCA bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x04, "PCI-to-PCI bridge", NULL, PCIbrg_devices, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x05, "PCMCIA bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x06, "NUBUS bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x07, "cardbus bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x08, "raceway bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x09, "semi-transparent PCI-to-PCI bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x0A, "infiniband-to-PCI bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc PCI bridge", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_iface_t serial_iface[] = {
+ {
+ 0x00, "XT serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "16450 serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "16550 serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x03, "16650 serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x04, "16750 serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x05, "16850 serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x06, "16950 serial controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_iface_t par_iface[] = {
+ {
+ 0x00, "parallel port", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "bi-directional parallel port", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "ECP 1.x parallel port", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x03, "IEEE 1284 controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFE, "IEEE 1284 device", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_iface_t modem_iface[] = {
+ {
+ 0x00, "generic modem", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "Hayes 16450 modem", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "Hayes 16550 modem", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x03, "Hayes 16650 modem", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x04, "Hayes 16750 modem", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_subclass_t comm_subclass[] = {
+ {
+ 0x00, "serial controller", NULL, NULL, serial_iface,
+ NULL, NULL,
+ },
+ {
+ 0x01, "parallel port", NULL, NULL, par_iface,
+ NULL, NULL,
+ },
+ {
+ 0x02, "multiport serial controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "modem", NULL, NULL, modem_iface,
+ NULL, NULL,
+ },
+ {
+ 0x04, "GPIB controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x05, "smart card", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc communication device", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_iface_t pic_iface[] = {
+ {
+ 0x00, "8259 PIC", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "ISA PIC", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "EISA PIC", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x10, "I/O APIC", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x20, "I/O APIC", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_iface_t dma_iface[] = {
+ {
+ 0x00, "8237 DMA controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "ISA DMA controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "EISA DMA controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_iface_t tmr_iface[] = {
+ {
+ 0x00, "8254 system timer", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "ISA system timer", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "EISA system timer", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_iface_t rtc_iface[] = {
+ {
+ 0x00, "generic RTC controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "ISA RTC controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_dev_t sys_devices[] = {
+ /* IBM MPIC controller */
+ {
+ 0x1014, 0x0002,
+ "open-pic", "MPIC", NULL, "chrp,open-pic\0",
+ 0, 0, 2,
+ NULL, NULL,
+ },
+ /* IBM MPIC2 controller */
+ {
+ 0x1014, 0xFFFF,
+ "open-pic", "MPIC2", NULL, "chrp,open-pic\0",
+ 0, 0, 2,
+ NULL, NULL,
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t sys_subclass[] = {
+ {
+ 0x00, "PIC", NULL, NULL, pic_iface,
+ NULL, NULL,
+ },
+ {
+ 0x01, "DMA controller", NULL, NULL, dma_iface,
+ NULL, NULL,
+ },
+ {
+ 0x02, "system timer", NULL, NULL, tmr_iface,
+ NULL, NULL,
+ },
+ {
+ 0x03, "RTC controller", NULL, NULL, rtc_iface,
+ NULL, NULL,
+ },
+ {
+ 0x04, "PCI hotplug controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc system peripheral", NULL, sys_devices, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t inp_subclass[] = {
+ {
+ 0x00, "keyboard controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "digitizer", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "mouse controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "scanner controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x04, "gameport controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc input device", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t dock_subclass[] = {
+ {
+ 0x00, "generic docking station", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc docking station", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t cpu_subclass[] = {
+ {
+ 0x00, "i386 processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "i486 processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "pentium processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x10, "alpha processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x20, "PowerPC processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x30, "MIPS processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x40, "co-processor", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_iface_t usb_iface[] = {
+ {
+ 0x00, "UHCI USB controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x10, "OHCI USB controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x20, "EHCI USB controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x80, "misc USB controller", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFE, "USB device", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_iface_t ipmi_iface[] = {
+ {
+ 0x00, "IPMI SMIC interface", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x01, "IPMI keyboard interface", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0x02, "IPMI block transfer interface", NULL,
+ NULL, NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL,
+ NULL, NULL, NULL,
+ },
+};
+
+static const pci_subclass_t ser_subclass[] = {
+ {
+ 0x00, "Firewire bus controller", "ieee1394", NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "ACCESS bus controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "SSA controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "USB controller", "usb", NULL, usb_iface,
+ NULL, NULL,
+ },
+ {
+ 0x04, "fibre channel controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x05, "SMBus controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x06, "InfiniBand controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x07, "IPMI interface", NULL, NULL, ipmi_iface,
+ NULL, NULL,
+ },
+ {
+ 0x08, "SERCOS controller", NULL, NULL, ipmi_iface,
+ NULL, NULL,
+ },
+ {
+ 0x09, "CANbus controller", NULL, NULL, ipmi_iface,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t wrl_subclass[] = {
+ {
+ 0x00, "IRDA controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "consumer IR controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x10, "RF controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x11, "bluetooth controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x12, "broadband controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc wireless controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t sat_subclass[] = {
+ {
+ 0x01, "satellite TV controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x02, "satellite audio controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x03, "satellite voice controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x04, "satellite data controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t crypt_subclass[] = {
+ {
+ 0x00, "cryptographic network controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x10, "cryptographic entertainment controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc cryptographic controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_subclass_t spc_subclass[] = {
+ {
+ 0x00, "DPIO module", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x01, "performances counters", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x10, "communication synchronisation", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x20, "management card", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0x80, "misc signal processing controller", NULL, NULL, NULL,
+ NULL, NULL,
+ },
+ {
+ 0xFF, NULL, NULL, NULL, NULL,
+ NULL, NULL,
+ },
+};
+
+static const pci_class_t pci_classes[] = {
+ /* 0x00 */
+ { "undefined", NULL, undef_subclass, },
+ /* 0x01 */
+ { "mass-storage controller", NULL, mass_subclass, },
+ /* 0x02 */
+ { "network controller", "network", net_subclass, },
+ /* 0x03 */
+ { "display controller", "display", displ_subclass, },
+ /* 0x04 */
+ { "multimedia device", NULL, media_subclass, },
+ /* 0x05 */
+ { "memory controller", "memory-controller", mem_subclass, },
+ /* 0x06 */
+ { "PCI bridge", "pci", bridg_subclass, },
+ /* 0x07 */
+ { "communication device", NULL, comm_subclass,},
+ /* 0x08 */
+ { "system peripheral", NULL, sys_subclass, },
+ /* 0x09 */
+ { "input device", NULL, inp_subclass, },
+ /* 0x0A */
+ { "docking station", NULL, dock_subclass, },
+ /* 0x0B */
+ { "processor", NULL, cpu_subclass, },
+ /* 0x0C */
+ { "serial bus controller", NULL, ser_subclass, },
+ /* 0x0D */
+ { "wireless controller", NULL, wrl_subclass, },
+ /* 0x0E */
+ { "intelligent I/O controller", NULL, NULL, },
+ /* 0x0F */
+ { "satellite communication controller", NULL, sat_subclass, },
+ /* 0x10 */
+ { "cryptographic controller", NULL, crypt_subclass, },
+ /* 0x11 */
+ { "signal processing controller", NULL, spc_subclass, },
+};
+
+static const pci_dev_t misc_pci[] = {
+ /* Paddington Mac I/O */
+ {
+ 0x106B, 0x0017,
+ "mac-io", "mac-io", "AAPL,343S1211", "paddington\0heathrow\0",
+ 1, 1, 1,
+ &macio_config_cb, NULL,
+ },
+ /* KeyLargo Mac I/O */
+ {
+ 0x106B, 0x0022,
+ "mac-io", "mac-io", "AAPL,Keylargo", "Keylargo\0",
+ 1, 1, 2,
+ &macio_config_cb, NULL,
+ },
+ {
+ 0xFFFF, 0xFFFF,
+ NULL, NULL, NULL, NULL,
+ -1, -1, -1,
+ NULL, NULL,
+ },
+};
+
+const pci_dev_t *pci_find_device (uint8_t class, uint8_t subclass,
+ uint8_t iface, uint16_t vendor,
+ uint16_t product)
+{
+ int (*config_cb)(const pci_config_t *config);
+ const pci_class_t *pclass;
+ const pci_subclass_t *psubclass;
+ const pci_iface_t *piface;
+ const pci_dev_t *dev;
+ const void *private;
+ pci_dev_t *new;
+ const char *name, *type;
+
+ name = "unknown";
+ type = "unknown";
+ config_cb = NULL;
+ private = NULL;
+
+ if (class == 0x00 && subclass == 0x01) {
+ /* Special hack for old style VGA devices */
+ class = 0x03;
+ subclass = 0x00;
+ } else if (class == 0xFF) {
+ /* Special case for misc devices */
+ dev = misc_pci;
+ goto find_device;
+ }
+ if (class > (sizeof(pci_classes) / sizeof(pci_class_t))) {
+ name = "invalid PCI device";
+ type = "invalid";
+ goto bad_device;
+ }
+ pclass = &pci_classes[class];
+ name = pclass->name;
+ type = pclass->type;
+ for (psubclass = pclass->subc; ; psubclass++) {
+ if (psubclass->subclass == 0xFF)
+ goto bad_device;
+ if (psubclass->subclass == subclass) {
+ if (psubclass->name != NULL)
+ name = psubclass->name;
+ if (psubclass->type != NULL)
+ type = psubclass->type;
+ if (psubclass->config_cb != NULL) {
+ config_cb = psubclass->config_cb;
+ }
+ if (psubclass->private != NULL)
+ private = psubclass->private;
+ if (psubclass->iface != NULL)
+ break;
+ dev = psubclass->devices;
+ goto find_device;
+ }
+ }
+ for (piface = psubclass->iface; ; piface++) {
+ if (piface->iface == 0xFF) {
+ dev = psubclass->devices;
+ break;
+ }
+ if (piface->iface == iface) {
+ if (piface->name != NULL)
+ name = piface->name;
+ if (piface->type != NULL)
+ type = piface->type;
+ if (piface->config_cb != NULL) {
+ config_cb = piface->config_cb;
+ }
+ if (piface->private != NULL)
+ private = piface->private;
+ dev = piface->devices;
+ break;
+ }
+ }
+ find_device:
+ for (;; dev++) {
+ if (dev->vendor == 0xFFFF && dev->product == 0xFFFF) {
+ goto bad_device;
+ }
+ if (dev->vendor == vendor && dev->product == product) {
+ if (dev->name != NULL)
+ name = dev->name;
+ if (dev->type != NULL)
+ type = dev->type;
+ if (dev->config_cb != NULL) {
+ config_cb = dev->config_cb;
+ }
+ if (dev->private != NULL)
+ private = dev->private;
+ new = malloc(sizeof(pci_dev_t));
+ if (new == NULL)
+ return NULL;
+ new->vendor = vendor;
+ new->product = product;
+ new->type = type;
+ new->name = name;
+ new->model = dev->model;
+ new->compat = dev->compat;
+ new->acells = dev->acells;
+ new->scells = dev->scells;
+ new->icells = dev->icells;
+ new->config_cb = config_cb;
+ new->private = private;
+
+ return new;
+ }
+ }
+ bad_device:
+ printk("Cannot manage '%s' PCI device type '%s':\n %x %x (%x %x %x)\n",
+ name, type, vendor, product, class, subclass, iface);
+
+ return NULL;
+}
Added: openbios-devel/drivers/pci_database.h
===================================================================
--- openbios-devel/drivers/pci_database.h (rev 0)
+++ openbios-devel/drivers/pci_database.h 2008-12-31 16:21:08 UTC (rev 334)
@@ -0,0 +1,43 @@
+typedef struct pci_config_t pci_config_t;
+
+struct pci_config_t {
+ char path[256];
+ uint32_t regions[7];
+ uint32_t sizes[7];
+};
+
+typedef struct pci_dev_t pci_dev_t;
+struct pci_dev_t {
+ uint16_t vendor;
+ uint16_t product;
+ const char *type;
+ const char *name;
+ const char *model;
+ const char *compat;
+ int acells;
+ int scells;
+ int icells;
+ int (*config_cb)(const pci_config_t *config);
+ const void *private;
+};
+
+extern int ide_config_cb2(const pci_config_t *config);
+extern int eth_config_cb(const pci_config_t *config);
+extern int macio_config_cb(const pci_config_t *config);
+extern int vga_config_cb(const pci_config_t *config);
+
+static inline int pci_compat_len(pci_dev_t *dev)
+{
+ int len, ret;
+ const char *path = dev->compat;
+ ret = 0;
+ while ((len = strlen(path)) != 0) {
+ ret += len + 1;
+ path += len + 1;
+ }
+ return ret;
+}
+
+extern const pci_dev_t *pci_find_device(uint8_t class, uint8_t subclass,
+ uint8_t iface, uint16_t vendor,
+ uint16_t product);
1
0
Author: blueswirl
Date: 2008-12-31 17:19:15 +0100 (Wed, 31 Dec 2008)
New Revision: 333
Modified:
openbios-devel/arch/ppc/qemu/init.c
openbios-devel/arch/ppc/qemu/ofmem.c
openbios-devel/include/ofmem.h
Log:
Define the translations property for cpu (Laurent Vivier)
Modified: openbios-devel/arch/ppc/qemu/init.c
===================================================================
--- openbios-devel/arch/ppc/qemu/init.c 2008-12-31 16:18:34 UTC (rev 332)
+++ openbios-devel/arch/ppc/qemu/init.c 2008-12-31 16:19:15 UTC (rev 333)
@@ -28,6 +28,7 @@
#include "ofmem.h"
#include "openbios-version.h"
#include "libc/byteorder.h"
+#include "libc/vsprintf.h"
#define NO_QEMU_PROTOS
#include "openbios/fw_cfg.h"
@@ -424,6 +425,7 @@
#endif
uint64_t ram_size;
const struct cpudef *cpu;
+ char buf[64];
devtree_init();
@@ -485,6 +487,8 @@
#ifdef CONFIG_DRIVER_PCI
ob_pci_init();
#endif
+ snprintf(buf, sizeof(buf), "/cpus/%s", cpu->name);
+ ofmem_register(find_dev(buf));
node_methods_init();
#ifdef USE_RTAS
Modified: openbios-devel/arch/ppc/qemu/ofmem.c
===================================================================
--- openbios-devel/arch/ppc/qemu/ofmem.c 2008-12-31 16:18:34 UTC (rev 332)
+++ openbios-devel/arch/ppc/qemu/ofmem.c 2008-12-31 16:19:15 UTC (rev 333)
@@ -110,6 +110,36 @@
return (ulong)OF_MALLOC_BASE;
}
+static phandle_t cpu_handle = 0;
+static void
+ofmem_update_translations( void )
+{
+ ofmem_t *ofmem = OFMEM;
+ translation_t *t;
+ int ncells;
+ cell *props;
+
+ if (cpu_handle == 0)
+ return;
+
+ for( t = ofmem->trans, ncells = 0; t ; t=t->next, ncells++ )
+ ;
+
+ props = malloc(ncells * sizeof(cell) * 4);
+ if (props == NULL)
+ return;
+
+ for( t = ofmem->trans, ncells = 0 ; t ; t=t->next ) {
+ props[ncells++] = t->virt;
+ props[ncells++] = t->size;
+ props[ncells++] = t->phys;
+ props[ncells++] = t->mode;
+ }
+ set_property(cpu_handle, "translations",
+ (char*)props, ncells * sizeof(cell));
+ free(props);
+}
+
/************************************************************************/
/* OF private allocations */
/************************************************************************/
@@ -502,6 +532,8 @@
t->next = *tt;
*tt = t;
+ ofmem_update_translations();
+
return 0;
}
@@ -703,3 +735,10 @@
ofmem_claim_phys( get_ram_top(), get_ram_size() - get_ram_top(), 0);
ofmem_claim_virt( get_ram_top(), get_ram_size() - get_ram_top(), 0);
}
+
+void
+ofmem_register( phandle_t ph )
+{
+ cpu_handle = ph;
+ ofmem_update_translations();
+}
Modified: openbios-devel/include/ofmem.h
===================================================================
--- openbios-devel/include/ofmem.h 2008-12-31 16:18:34 UTC (rev 332)
+++ openbios-devel/include/ofmem.h 2008-12-31 16:19:15 UTC (rev 333)
@@ -36,6 +36,7 @@
void dsi_exception( void );
void isi_exception( void );
void setup_mmu( ulong ramsize );
+void ofmem_register( phandle_t ph );
#endif
#endif /* _H_OFMEM */
1
0
Author: blueswirl
Date: 2008-12-31 17:18:34 +0100 (Wed, 31 Dec 2008)
New Revision: 332
Modified:
openbios-devel/arch/ppc/qemu/tree.fs
openbios-devel/drivers/ide.c
Log:
Remove unused definition from qemu/tree.fs and move cd and hd alias
definition to ide.c (Laurent Vivier)
Modified: openbios-devel/arch/ppc/qemu/tree.fs
===================================================================
--- openbios-devel/arch/ppc/qemu/tree.fs 2008-12-31 15:43:34 UTC (rev 331)
+++ openbios-devel/arch/ppc/qemu/tree.fs 2008-12-31 16:18:34 UTC (rev 332)
@@ -1,7 +1,5 @@
\ Qemu specific initialization code
\
-\ Copyright (C) 2005 Stefan Reinauer
-\
\ 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
@@ -13,13 +11,23 @@
" /" find-device
-" chrp" device-type
-" OpenSource,QEMU" model
-" Power Macintosh" encode-string " compatible" property
-1 encode-int " #interrupt-cells" property
+" bootrom" device-type
+" PowerMac1,1" model
+" PowerMac1,1" encode-string
+" MacRisc" encode-string encode+
+" Power Macintosh" encode-string encode+ " compatible" property
+" 0000000000000" encode-string " system-id" property
+1 encode-int " #address-cells" property
1 encode-int " #size-cells" property
+h# 0x05f5e100 encode-int " clock-frequency" property
new-device
+ " cpus" device-name
+ 1 encode-int " #address-cells" property
+ 0 encode-int " #size-cells" property
+finish-device
+
+new-device
" memory" device-name
" memory" device-type
external
@@ -34,222 +42,6 @@
0 encode-int " #size-cells" property
finish-device
-" /pci" find-device
- h# 01000000 encode-int 0 encode-int encode+ 0 encode-int encode+
- h# 80000000 encode-int encode+ 0 encode-int encode+
- h# 01000000 encode-int encode+
- h# 02000000 encode-int encode+ 0 encode-int encode+ 0 encode-int encode+
- h# C0000000 encode-int encode+ 0 encode-int encode+
- h# 08000000 encode-int encode+
- " ranges" property
- " IBM,CPC710" model
- h# FF5F7700 encode-int " 8259-interrupt-acknowledge" property
- h# 0000F800 encode-int 0 encode-int encode+ 0 encode-int encode+
- 7 encode-int encode+
- " interrupt-map-mask" property
- 1 encode-int " #interrupt-cells" property
- h# 80000000 encode-int " system-dma-base" property
- d# 33333333 encode-int " clock-frequency" property
- " " encode-string " primary-bridge" property
- 0 encode-int " pci-bridge-number" property
- h# FEC00000 encode-int h# 100000 encode-int encode+ " reg" property
- 0 encode-int 0 encode-int encode+ " bus-range" property
-
-new-device
- " isa" device-name
- " isa" device-type
- 2 encode-int " #address-cells" property
- 1 encode-int " #size-cells" property
-
- external
- : open true ;
- : close ;
-
-finish-device
-
-: ?devalias ( alias-str alias-len device-str device-len --
- \ alias-str alias-len false | true )
- active-package >r
- " /aliases" find-device
- \ 2dup ." Checking " type
- 2dup find-dev if \ check if device exists
- drop
- 2over find-dev if \ do we already have an alias?
- \ ." alias exists" cr
- drop 2drop false
- else
- \ ." device exists" cr
- encode-string
- 2swap property
- true
- then
- else
- \ ." device doesn't exist" cr
- 2drop false
- then
- r> active-package!
- ;
-
-:noname
- " hd"
- " /pci/pci-ata/ata-1/disk@0" ?devalias not if
- " /pci/pci-ata/ata-1/disk@1" ?devalias not if
- " /pci/pci-ata/ata-2/disk@0" ?devalias not if
- " /pci/pci-ata/ata-2/disk@1" ?devalias not if
- 2drop ." No disk found." cr
- then
- then
- then
- then
-
- " cd"
- " /pci/pci-ata/ata-1/cdrom@0" ?devalias not if
- " /pci/pci-ata/ata-1/cdrom@1" ?devalias not if
- " /pci/pci-ata/ata-2/cdrom@0" ?devalias not if
- " /pci/pci-ata/ata-2/cdrom@1" ?devalias not if
- 2drop ." No cdrom found" cr
- then
- then
- then
- then
-; SYSTEM-initializer
-
-new-device
- " ide" device-name
- " ide" device-type
- " WINBOND,82C553" model
- h# 28 encode-int " max-latency" property
- h# 2 encode-int " min-grant" property
- h# 1 encode-int " devsel-speed" property
- h# 0 encode-int " subsystem-vendor-id" property
- h# 0 encode-int " subsystem-id" property
- h# 1018A encode-int " class-code" property
- h# 5 encode-int " revision-id" property
- h# 105 encode-int " device-id" property
- h# 10AD encode-int " vendor-id" property
- h# 1003110 encode-int 0 encode-int encode+ h# 10020 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- h# 1003114 encode-int 0 encode-int encode+ h# 10030 encode-int encode+
- h# 4 encode-int encode+ 0 encode-int encode+
- h# 1003118 encode-int 0 encode-int encode+ h# 10040 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- h# 100311C encode-int 0 encode-int encode+ h# 10034 encode-int encode+
- h# 4 encode-int encode+ 0 encode-int encode+
- h# 1003120 encode-int 0 encode-int encode+ h# 10050 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- h# 1003124 encode-int 0 encode-int encode+ h# 10060 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- " assigned-addresses" property
- h# 3100 encode-int 0 encode-int encode+ 0 encode-int encode+
- 0 encode-int encode+ 0 encode-int encode+
- h# 1003110 encode-int 0 encode-int encode+ h# 0 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- h# 1003114 encode-int 0 encode-int encode+ h# 0 encode-int encode+
- h# 4 encode-int encode+ 0 encode-int encode+
- h# 1003118 encode-int 0 encode-int encode+ h# 0 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- h# 100311C encode-int 0 encode-int encode+ h# 0 encode-int encode+
- h# 4 encode-int encode+ 0 encode-int encode+
- h# 1003120 encode-int 0 encode-int encode+ h# 0 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- h# 1003124 encode-int 0 encode-int encode+ h# 0 encode-int encode+
- h# 10 encode-int encode+ 0 encode-int encode+
- " reg" property
-finish-device
-
-new-device
- " ethernet" device-name
- " network" device-type
- " AMD,79C973" model
- h# 3800 encode-int 0 encode-int encode+ 0 encode-int encode+
- 0 encode-int encode+ 0 encode-int encode+
- " reg" property
-finish-device
-
-" /pci/isa" find-device
- 0 0 " assigned-addresses" property
- 0 0 " ranges" property
- 0 encode-int " slot-names" property
- d# 8333333 encode-int " clock-frequency" property
- 0 encode-int " eisa-slots" property
- 2 encode-int " #interrupt-cells" property
- " W83C553F" encode-string " compatible" property
- " WINBOND,82C553" model
- 0 encode-int " max-latency" property
- 0 encode-int " min-grant" property
- 1 encode-int " devsel-speed" property
- 0 encode-int " subsystem-vendor-id" property
- 0 encode-int " subsystem-id" property
- h# 60100 encode-int " class-code" property
- h# 10 encode-int " revision-id" property
- h# 565 encode-int " device-id" property
- h# 10AD encode-int " vendor-id" property
- h# 3000 encode-int 0 encode-int encode+ 0 encode-int encode+
- 0 encode-int encode+ 0 encode-int encode+ " reg" property
-
-new-device
- " rtc" device-name
- " rtc" device-type
- " DS17285S" model
- " MC146818" encode-string
- " DS17285S" encode-string encode+
- " pnpPNP,b00" encode-string encode+ " compatible" property
- 8 encode-int 0 encode-int encode+ " interrupts" property
- h# 70 encode-int 1 encode-int encode+
- 2 encode-int encode+ " reg" property
-finish-device
-
-new-device
- " interrupt-controller" device-name
- " interrupt-controller" device-type
- " 8259" model
- " " encode-string " interrupt-controller" property
- 2 encode-int " #interrupt-cells" property
- 1 encode-int
- 2 encode-int encode+
- 3 encode-int encode+
- 6 encode-int encode+
- " reserved-interrupts" property
- " 8259" encode-string
- " chrp,iic" encode-string encode+
- " compatible" property
- h# 20 encode-int 1 encode-int encode+
- 2 encode-int encode+ " reg" property
-finish-device
-
-new-device
- " serial" device-name
- " serial" device-type
- " no" encode-string " ctsrts" property
- " no" encode-string " xon" property
- " no" encode-string " parity" property
- d# 115200 encode-int " bps" property
- 1 encode-int " stop-bits" property
- 8 encode-int " data-bits" property
- h# 70800 encode-int " divisor" property
- h# 708000 encode-int " clock-frequency" property
- 4 encode-int 0 encode-int encode+ " interrupts" property
- h# 3F8 encode-int 1 encode-int encode+
- 8 encode-int encode+ " reg" property
-finish-device
-
-" /pci" find-device
- " /pci/isa/interrupt-controller" find-dev if
- encode-int " interrupt-parent" property
- then
- h# 3800 encode-int 0 encode-int encode+
- 0 encode-int encode+ 1 encode-int encode+
- " /pci/isa/interrupt-controller" find-dev if
- encode-int encode+
- then
- h# 0C encode-int encode+ 1 encode-int encode+
- " interrupt-map" property
-
-" /pci/isa" find-device
- " /pci/isa/interrupt-controller" find-dev if
- encode-int " interrupt-parent" property
- then
-
\ -------------------------------------------------------------
\ /packages
\ -------------------------------------------------------------
Modified: openbios-devel/drivers/ide.c
===================================================================
--- openbios-devel/drivers/ide.c 2008-12-31 15:43:34 UTC (rev 331)
+++ openbios-devel/drivers/ide.c 2008-12-31 16:18:34 UTC (rev 332)
@@ -1314,8 +1314,13 @@
{
int i, j;
char nodebuff[32];
- phandle_t dnode;
+ phandle_t dnode, aliases;
+ int hd_found, cd_found;
+ aliases = find_dev("/aliases");
+ hd_found = 0;
+ cd_found = 0;
+
io_ports[0] = io_port0;
ctl_ports[0] = ctl_port0 + 2;
io_ports[1] = io_port1;
@@ -1404,6 +1409,19 @@
REGISTER_NAMED_NODE(ob_ide, nodebuff);
dnode=find_dev(nodebuff);
set_int_property(dnode, "reg", j);
+
+ /* create aliases */
+
+ if (drive->media == ide_media_cdrom && !cd_found) {
+ cd_found = 1;
+ set_property(aliases, "cd",
+ nodebuff, strlen(nodebuff) + 1);
+ }
+ if (drive->media == ide_media_disk && !hd_found) {
+ hd_found = 1;
+ set_property(aliases, "hd",
+ nodebuff, strlen(nodebuff) + 1);
+ }
}
}
1
0
Author: blueswirl
Date: 2008-12-31 16:43:34 +0100 (Wed, 31 Dec 2008)
New Revision: 331
Modified:
openbios-devel/config/examples/cross-ppc_config.xml
openbios-devel/drivers/ide.c
Log:
Remove debug printk when IDE debugging is disabled (Laurent Vivier)
Modified: openbios-devel/config/examples/cross-ppc_config.xml
===================================================================
--- openbios-devel/config/examples/cross-ppc_config.xml 2008-12-28 16:35:39 UTC (rev 330)
+++ openbios-devel/config/examples/cross-ppc_config.xml 2008-12-31 15:43:34 UTC (rev 331)
@@ -64,7 +64,7 @@
<!-- Drivers -->
<option name="CONFIG_DRIVER_PCI" type="boolean" value="true"/>
- <option name="CONFIG_DEBUG_PCI" type="boolean" value="true"/>
+ <option name="CONFIG_DEBUG_PCI" type="boolean" value="false"/>
<option name="CONFIG_DRIVER_IDE" type="boolean" value="true"/>
<option name="CONFIG_IDE_NUM_CHANNELS" type="integer" value="2"/>
<option name="CONFIG_IDE_FIRST_UNIT" type="integer" value="1"/>
Modified: openbios-devel/drivers/ide.c
===================================================================
--- openbios-devel/drivers/ide.c 2008-12-28 16:35:39 UTC (rev 330)
+++ openbios-devel/drivers/ide.c 2008-12-31 15:43:34 UTC (rev 331)
@@ -1364,9 +1364,11 @@
snprintf(nodebuff, sizeof(nodebuff), "%s/" DEV_NAME, path,
current_channel);
REGISTER_NAMED_NODE(ob_ide_ctrl, nodebuff);
+#ifdef CONFIG_DEBUG_IDE
printk(DEV_NAME": [io ports 0x%x-0x%x,0x%x]\n",
current_channel, chan->io_regs[0],
chan->io_regs[0] + 7, chan->io_regs[8]);
+#endif
for (j = 0; j < 2; j++) {
struct ide_drive *drive = &chan->drives[j];
@@ -1375,7 +1377,10 @@
if (!drive->present)
continue;
- printk(" drive%d [ATA%s ", j, drive->type == ide_type_atapi ? "PI" : "");
+#ifdef CONFIG_DEBUG_IDE
+ printk(" drive%d [ATA%s ", j,
+ drive->type == ide_type_atapi ? "PI" : "");
+#endif
switch (drive->media) {
case ide_media_floppy:
media = "floppy";
@@ -1390,7 +1395,9 @@
media = "disk";
break;
}
+#ifdef CONFIG_DEBUG_IDE
printk("%s]: %s\n", media, drive->model);
+#endif
snprintf(nodebuff, sizeof(nodebuff),
"%s/" DEV_NAME "/%s", path, current_channel,
media);
1
0