NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: PR/48431 CVS commit: src/sys/arch/alpha/pci
The following reply was made to PR port-alpha/48431; it has been noted by GNATS.
From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: nullnilaki%gmail.com@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: PR/48431 CVS commit: src/sys/arch/alpha/pci
Date: Sun, 19 Jan 2014 12:38:00 +0900
> > --- dec_6600.c 13 Oct 2012 17:58:54 -0000 1.34
> > +++ dec_6600.c 13 Jan 2014 16:18:09 -0000
> > @@ -201,6 +201,21 @@ dec_6600_device_register(device_t dev, v
> > struct bootdev_data *b = bootdev_data;
> > device_t parent = device_parent(dev);
> >
> > + /* set properties for PCI framebuffers */
:
> I apply this patch.
> It work fine and radeonfb attached correctly.
Thanks.
After some thoughts, I notice x86 ports have device_pci_register()
in sys/arch/x86/pci/pci_machidep.c and now I think it's better to put
a common PCI specific device_register function in alpha/pci/pci_machidep.c.
Could you also try the following patch (after revert previous
dec_6600.c diff)?
---
Index: alpha/autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/alpha/autoconf.c,v
retrieving revision 1.52
diff -u -p -r1.52 autoconf.c
--- alpha/autoconf.c 29 Jul 2012 18:05:39 -0000 1.52
+++ alpha/autoconf.c 18 Jan 2014 14:08:35 -0000
@@ -44,6 +44,8 @@
__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.52 2012/07/29 18:05:39 mlelstv Exp
$");
+#include "pci.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
@@ -53,6 +55,8 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
#include <sys/conf.h>
#include <dev/cons.h>
+#include <dev/pci/pcivar.h>
+
#include <machine/autoconf.h>
#include <machine/alpha.h>
#include <machine/cpu.h>
@@ -172,6 +176,13 @@ atoi(const char *s)
void
device_register(device_t dev, void *aux)
{
+#if NPCI > 0
+ device_t parent = device_parent(dev);
+
+ if (parent != NULL && device_is_a(parent, "pci"))
+ device_pci_register(dev, aux);
+#endif
+
if (bootdev_data == NULL) {
/*
* There is no hope.
Index: include/pci_machdep.h
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/include/pci_machdep.h,v
retrieving revision 1.15
diff -u -p -r1.15 pci_machdep.h
--- include/pci_machdep.h 6 Feb 2012 02:14:13 -0000 1.15
+++ include/pci_machdep.h 18 Jan 2014 14:08:35 -0000
@@ -109,3 +109,4 @@ void pci_display_console(bus_space_tag_t
((c)->pc_pciide_compat_intr_establish == NULL ? NULL : \
(*(c)->pc_pciide_compat_intr_establish)((c)->pc_conf_v, (d), (p),
\
(ch), (f), (a)))
+void device_pci_register(device_t, void *);
Index: pci/pci_machdep.c
===================================================================
RCS file: /cvsroot/src/sys/arch/alpha/pci/pci_machdep.c,v
retrieving revision 1.19
diff -u -p -r1.19 pci_machdep.c
--- pci/pci_machdep.c 6 Feb 2012 02:14:15 -0000 1.19
+++ pci/pci_machdep.c 18 Jan 2014 14:08:35 -0000
@@ -59,6 +59,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci_machdep.
#include <dev/pci/tgavar.h>
#endif
+#include <machine/rpb.h>
+
void
pci_display_console(bus_space_tag_t iot, bus_space_tag_t memt,
pci_chipset_tag_t pc, int bus, int device, int function)
{
@@ -101,3 +103,20 @@ pci_display_console(bus_space_tag_t iot,
panic("pci_display_console: unconfigured device at %d/%d/%d",
bus, device, function);
}
+
+void
+device_pci_register(device_t dev, void *aux)
+{
+ struct pci_attach_args *pa = aux;
+ struct ctb *ctb;
+ prop_dictionary_t dict;
+
+ /* set properties for PCI framebuffers */
+ ctb = (struct ctb *)(((char *)hwrpb) + hwrpb->rpb_ctb_off);
+ if (PCI_CLASS(pa->pa_class) == PCI_CLASS_DISPLAY &&
+ ctb->ctb_term_type == CTB_GRAPHICS) {
+ /* XXX should consider multiple displays? */
+ dict = device_properties(dev);
+ prop_dictionary_set_bool(dict, "is_console", true);
+ }
+}
---
> > --- pci/tsp_bus_mem.c 6 Feb 2012 02:14:15 -0000 1.12
> > +++ pci/tsp_bus_mem.c 15 Jan 2014 15:18:22 -0000
:
> > -#define CHIP_MEM_SYS_START(v) (((struct tsp_config *)(v))->pc_iobase)
> > +#define CHIP_MEM_SYS_START(v) \
> > + (((struct tsp_config *)(v))->pc_iobase | P_PCI_MEM)
:
> I apply this patch.
> It work fine!
Thanks. I'll commit this part soon.
> >return (alpha_btop(ALPHA_PHYS_TO_K0SEG(CHIP_MEM_SYS_START(v) + addr +
> off)));
> My patch is work but it is very very rare instances.
> I guess it should be MMU's magic!
I guess some higher bits (around P_PCI_MEM) are ignored in pmap_enter()
or alpha's MMU (but not sure).
> > Can you any info why we need DEPTH_32 and
>
> Why I used to "32bpp display mode" because Xorg with wsfb driver is
> wrong on "8bpp display mode" and Xorg's radeon driver is wrong on alpha.
> I guess radeonfb_getcmap function and radeonfb_putcmap function hasn't
> been implemented yet.
If this problem is not port specific, I wonder if we should make
32BPP default..
> > how does radeonfb_set_backlight() function fail?
> This patch is not necessary.
Ok, I'll leave this part.
---
Izumi Tsutsui
Home |
Main Index |
Thread Index |
Old Index