Lines Matching +full:mmu +full:- +full:500 +full:s

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2007-2011, Intel Corporation.
45 * to the different groups of PowerVR 5-series chip designs
49 * PowerVR SGX535 - Poulsbo - Intel GMA 500, Intel Atom Z5xx
50 * PowerVR SGX535 - Moorestown - Intel GMA 600
51 * PowerVR SGX535 - Oaktrail - Intel GMA 600, Intel Atom Z6xx, E6xx
52 * PowerVR SGX545 - Cedartrail - Intel GMA 3600, Intel Atom D2500, N2600
53 * PowerVR SGX545 - Cedartrail - Intel GMA 3650, Intel Atom D2550, D2700,
98 * psb_spank - reset the 2D engine
124 PSB_WSGX32(dev_priv->gtt.gatt_start, PSB_CR_BIF_TWOD_REQ_BASE); in psb_spank()
130 struct psb_gtt *pg = &dev_priv->gtt; in psb_do_init()
134 if (pg->mmu_gatt_start & 0x0FFFFFFF) { in psb_do_init()
135 dev_err(dev->dev, "Gatt must be 256M aligned. This is a bug.\n"); in psb_do_init()
136 return -EINVAL; in psb_do_init()
139 stolen_gtt = (pg->stolen_size >> PAGE_SHIFT) * 4; in psb_do_init()
140 stolen_gtt = (stolen_gtt + PAGE_SIZE - 1) >> PAGE_SHIFT; in psb_do_init()
141 stolen_gtt = (stolen_gtt < pg->gtt_pages) ? stolen_gtt : pg->gtt_pages; in psb_do_init()
143 dev_priv->gatt_free_offset = pg->mmu_gatt_start + in psb_do_init()
146 spin_lock_init(&dev_priv->irqmask_lock); in psb_do_init()
152 /* Do not bypass any MMU access, let them pagefault instead */ in psb_do_init()
160 PSB_WSGX32(pg->gatt_start, PSB_CR_BIF_TWOD_REQ_BASE); in psb_do_init()
177 if (dev_priv->ops->chip_teardown) in psb_driver_unload()
178 dev_priv->ops->chip_teardown(dev); in psb_driver_unload()
182 if (dev_priv->pf_pd) { in psb_driver_unload()
183 psb_mmu_free_pagedir(dev_priv->pf_pd); in psb_driver_unload()
184 dev_priv->pf_pd = NULL; in psb_driver_unload()
186 if (dev_priv->mmu) { in psb_driver_unload()
187 struct psb_gtt *pg = &dev_priv->gtt; in psb_driver_unload()
191 (dev_priv->mmu), in psb_driver_unload()
192 pg->mmu_gatt_start, in psb_driver_unload()
193 dev_priv->vram_stolen_size >> PAGE_SHIFT); in psb_driver_unload()
194 psb_mmu_driver_takedown(dev_priv->mmu); in psb_driver_unload()
195 dev_priv->mmu = NULL; in psb_driver_unload()
199 if (dev_priv->scratch_page) { in psb_driver_unload()
200 set_pages_wb(dev_priv->scratch_page, 1); in psb_driver_unload()
201 __free_page(dev_priv->scratch_page); in psb_driver_unload()
202 dev_priv->scratch_page = NULL; in psb_driver_unload()
204 if (dev_priv->vdc_reg) { in psb_driver_unload()
205 iounmap(dev_priv->vdc_reg); in psb_driver_unload()
206 dev_priv->vdc_reg = NULL; in psb_driver_unload()
208 if (dev_priv->sgx_reg) { in psb_driver_unload()
209 iounmap(dev_priv->sgx_reg); in psb_driver_unload()
210 dev_priv->sgx_reg = NULL; in psb_driver_unload()
212 if (dev_priv->aux_reg) { in psb_driver_unload()
213 iounmap(dev_priv->aux_reg); in psb_driver_unload()
214 dev_priv->aux_reg = NULL; in psb_driver_unload()
216 pci_dev_put(dev_priv->aux_pdev); in psb_driver_unload()
217 pci_dev_put(dev_priv->lpc_pdev); in psb_driver_unload()
234 struct pci_dev *pdev = to_pci_dev(dev->dev); in psb_driver_load()
242 int ret = -ENOMEM; in psb_driver_load()
246 dev_priv->ops = (struct psb_ops *)flags; in psb_driver_load()
248 pg = &dev_priv->gtt; in psb_driver_load()
252 dev_priv->num_pipe = dev_priv->ops->pipes; in psb_driver_load()
256 dev_priv->vdc_reg = in psb_driver_load()
258 if (!dev_priv->vdc_reg) in psb_driver_load()
261 dev_priv->sgx_reg = ioremap(resource_start + dev_priv->ops->sgx_offset, in psb_driver_load()
263 if (!dev_priv->sgx_reg) in psb_driver_load()
267 int domain = pci_domain_nr(pdev->bus); in psb_driver_load()
269 dev_priv->aux_pdev = in psb_driver_load()
273 if (dev_priv->aux_pdev) { in psb_driver_load()
274 resource_start = pci_resource_start(dev_priv->aux_pdev, in psb_driver_load()
276 resource_len = pci_resource_len(dev_priv->aux_pdev, in psb_driver_load()
278 dev_priv->aux_reg = ioremap(resource_start, in psb_driver_load()
280 if (!dev_priv->aux_reg) in psb_driver_load()
286 dev_priv->aux_reg = dev_priv->vdc_reg; in psb_driver_load()
289 dev_priv->gmbus_reg = dev_priv->aux_reg; in psb_driver_load()
291 dev_priv->lpc_pdev = in psb_driver_load()
294 if (dev_priv->lpc_pdev) { in psb_driver_load()
295 pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA, in psb_driver_load()
296 &dev_priv->lpc_gpio_base); in psb_driver_load()
297 pci_write_config_dword(dev_priv->lpc_pdev, PSB_LPC_GBA, in psb_driver_load()
298 (u32)dev_priv->lpc_gpio_base | (1L<<31)); in psb_driver_load()
299 pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA, in psb_driver_load()
300 &dev_priv->lpc_gpio_base); in psb_driver_load()
301 dev_priv->lpc_gpio_base &= 0xffc0; in psb_driver_load()
302 if (dev_priv->lpc_gpio_base) in psb_driver_load()
304 dev_priv->lpc_gpio_base); in psb_driver_load()
306 pci_dev_put(dev_priv->lpc_pdev); in psb_driver_load()
307 dev_priv->lpc_pdev = NULL; in psb_driver_load()
311 dev_priv->gmbus_reg = dev_priv->vdc_reg; in psb_driver_load()
316 ret = dev_priv->ops->chip_setup(dev); in psb_driver_load()
323 ret = -ENOMEM; in psb_driver_load()
325 dev_priv->scratch_page = alloc_page(GFP_DMA32 | __GFP_ZERO); in psb_driver_load()
326 if (!dev_priv->scratch_page) in psb_driver_load()
329 set_pages_uc(dev_priv->scratch_page, 1); in psb_driver_load()
338 ret = -ENOMEM; in psb_driver_load()
340 dev_priv->mmu = psb_mmu_driver_init(dev, 1, 0, NULL); in psb_driver_load()
341 if (!dev_priv->mmu) in psb_driver_load()
344 dev_priv->pf_pd = psb_mmu_alloc_pd(dev_priv->mmu, 1, 0); in psb_driver_load()
345 if (!dev_priv->pf_pd) in psb_driver_load()
352 /* Add stolen memory to SGX MMU */ in psb_driver_load()
353 ret = psb_mmu_insert_pfn_sequence(psb_mmu_get_default_pd(dev_priv->mmu), in psb_driver_load()
354 dev_priv->stolen_base >> PAGE_SHIFT, in psb_driver_load()
355 pg->gatt_start, in psb_driver_load()
356 pg->stolen_size >> PAGE_SHIFT, 0); in psb_driver_load()
358 psb_mmu_set_pd_context(psb_mmu_get_default_pd(dev_priv->mmu), 0); in psb_driver_load()
359 psb_mmu_set_pd_context(dev_priv->pf_pd, 1); in psb_driver_load()
367 ret = drm_vblank_init(dev, dev_priv->num_pipe); in psb_driver_load()
375 dev_priv->vdc_irq_mask = 0; in psb_driver_load()
376 dev_priv->pipestat[0] = 0; in psb_driver_load()
377 dev_priv->pipestat[1] = 0; in psb_driver_load()
378 dev_priv->pipestat[2] = 0; in psb_driver_load()
379 spin_lock_irqsave(&dev_priv->irqmask_lock, irqflags); in psb_driver_load()
383 spin_unlock_irqrestore(&dev_priv->irqmask_lock, irqflags); in psb_driver_load()
387 dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ in psb_driver_load()
398 if (gma_encoder->type == INTEL_OUTPUT_LVDS || in psb_driver_load()
399 gma_encoder->type == INTEL_OUTPUT_MIPI) { in psb_driver_load()
412 return devm_add_action_or_reset(dev->dev, psb_device_release, dev); in psb_driver_load()
426 * We cannot yet easily find the framebuffer's location in memory. So in psb_pci_probe()
440 dev_priv = devm_drm_dev_alloc(&pdev->dev, &driver, struct drm_psb_private, dev); in psb_pci_probe()
443 dev = &dev_priv->dev; in psb_pci_probe()
447 ret = psb_driver_load(dev, ent->driver_data); in psb_pci_probe()
451 ret = drm_dev_register(dev, ent->driver_data); in psb_pci_probe()
506 return -ENODEV; in psb_init()