From de522ae742bd058780135eb21fe287e9a9dc263a Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Mon, 7 Jan 2008 05:54:05 +0100 Subject: Nouveau: move PPC bios copy to firstopen. --- shared-core/nouveau_state.c | 80 ++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 40 deletions(-) (limited to 'shared-core/nouveau_state.c') diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 16c86494..0695754b 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -285,9 +285,6 @@ nouveau_card_init(struct drm_device *dev) struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_engine *engine; int ret; -#if defined(__powerpc__) - struct device_node *dn; -#endif DRM_DEBUG("prev state = %d\n", dev_priv->init_state); @@ -295,43 +292,6 @@ nouveau_card_init(struct drm_device *dev) return 0; dev_priv->ttm = 0; - /* Map any PCI resources we need on the card */ - ret = nouveau_init_card_mappings(dev); - if (ret) return ret; - -#if defined(__powerpc__) - /* Put the card in BE mode if it's not */ - if (NV_READ(NV03_PMC_BOOT_1)) - NV_WRITE(NV03_PMC_BOOT_1,0x00000001); - - DRM_MEMORYBARRIER(); -#endif - -#if defined(__linux__) && defined(__powerpc__) - /* if we have an OF card, copy vbios to RAMIN */ - dn = pci_device_to_OF_node(dev->pdev); - if (dn) - { - int size; -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) - const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size); -#else - const uint32_t *bios = get_property(dn, "NVDA,BMP", &size); -#endif - if (bios) - { - int i; - for(i=0;icard_type < NV_10) dev_priv->chipset = dev_priv->card_type; @@ -451,6 +411,46 @@ void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) /* first module load, setup the mmio/fb mapping */ int nouveau_firstopen(struct drm_device *dev) { +#if defined(__powerpc__) + struct device_node *dn; +#endif + int ret; + /* Map any PCI resources we need on the card */ + ret = nouveau_init_card_mappings(dev); + if (ret) return ret; + +#if defined(__powerpc__) + /* Put the card in BE mode if it's not */ + if (NV_READ(NV03_PMC_BOOT_1)) + NV_WRITE(NV03_PMC_BOOT_1,0x00000001); + + DRM_MEMORYBARRIER(); +#endif + +#if defined(__linux__) && defined(__powerpc__) + /* if we have an OF card, copy vbios to RAMIN */ + dn = pci_device_to_OF_node(dev->pdev); + if (dn) + { + int size; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)) + const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size); +#else + const uint32_t *bios = get_property(dn, "NVDA,BMP", &size); +#endif + if (bios) + { + int i; + for(i=0;i Date: Mon, 7 Jan 2008 06:11:33 +0100 Subject: Nouveau: ppc oops. --- shared-core/nouveau_state.c | 1 + 1 file changed, 1 insertion(+) (limited to 'shared-core/nouveau_state.c') diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 0695754b..75353603 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -412,6 +412,7 @@ void nouveau_preclose(struct drm_device *dev, struct drm_file *file_priv) int nouveau_firstopen(struct drm_device *dev) { #if defined(__powerpc__) + struct drm_nouveau_private *dev_priv = dev->dev_private; struct device_node *dn; #endif int ret; -- cgit v1.2.3 From 3d248cd7e4538ced5c0b652a784eb4ef309d5e11 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 7 Jan 2008 17:23:31 +1100 Subject: nv50: hook up timer funcs... --- shared-core/nouveau_state.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'shared-core/nouveau_state.c') diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 75353603..8fe128c5 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -88,7 +88,6 @@ static int nouveau_init_card_mappings(struct drm_device *dev) static int nouveau_stub_init(struct drm_device *dev) { return 0; } static void nouveau_stub_takedown(struct drm_device *dev) {} -static uint64_t nouveau_stub_timer_read(struct drm_device *dev) { return 0; } static int nouveau_init_engine_ptrs(struct drm_device *dev) { @@ -251,9 +250,9 @@ static int nouveau_init_engine_ptrs(struct drm_device *dev) engine->instmem.unbind = nv50_instmem_unbind; engine->mc.init = nv50_mc_init; engine->mc.takedown = nv50_mc_takedown; - engine->timer.init = nouveau_stub_init; - engine->timer.read = nouveau_stub_timer_read; - engine->timer.takedown = nouveau_stub_takedown; + engine->timer.init = nv04_timer_init; + engine->timer.read = nv04_timer_read; + engine->timer.takedown = nv04_timer_takedown; engine->fb.init = nouveau_stub_init; engine->fb.takedown = nouveau_stub_takedown; engine->graph.init = nv50_graph_init; -- cgit v1.2.3 From 641c9a2ecccb4fd51e2453c18df5d1e6a209d6e3 Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Mon, 21 Jan 2008 21:01:28 +0100 Subject: nouveau: new card family for old card designs. --- shared-core/nouveau_state.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shared-core/nouveau_state.c') diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 8fe128c5..230090f1 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -498,7 +498,10 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) iounmap(regs); - if (architecture >= 0x50) { + if (architecture >= 0x60) { + /* FIXME we need to figure out who's who for NV6x */ + dev_priv->card_type = NV_44; + } else if (architecture >= 0x50) { dev_priv->card_type = NV_50; } else if (architecture >= 0x40) { uint8_t subarch = architecture & 0xf; -- cgit v1.2.3 From 616cef5ec84b97eb676ee7cc6699451d778fad3b Mon Sep 17 00:00:00 2001 From: Stephane Marchesin Date: Mon, 21 Jan 2008 21:11:47 +0100 Subject: nouveau: don't forget NV80. --- shared-core/nouveau_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shared-core/nouveau_state.c') diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c index 230090f1..7086a0ab 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -498,7 +498,9 @@ int nouveau_load(struct drm_device *dev, unsigned long flags) iounmap(regs); - if (architecture >= 0x60) { + if (architecture >= 0x80) { + dev_priv->card_type = NV_50; + } else if (architecture >= 0x60) { /* FIXME we need to figure out who's who for NV6x */ dev_priv->card_type = NV_44; } else if (architecture >= 0x50) { -- cgit v1.2.3