Path: blob/master/arch/powerpc/platforms/ps3/system-bus.c
50693 views
// SPDX-License-Identifier: GPL-2.0-only1/*2* PS3 system bus driver.3*4* Copyright (C) 2006 Sony Computer Entertainment Inc.5* Copyright 2006 Sony Corp.6*/78#include <linux/kernel.h>9#include <linux/init.h>10#include <linux/export.h>11#include <linux/dma-map-ops.h>12#include <linux/err.h>13#include <linux/slab.h>1415#include <asm/udbg.h>16#include <asm/lv1call.h>17#include <asm/firmware.h>18#include <asm/cell-regs.h>1920#include "platform.h"2122static struct device ps3_system_bus = {23.init_name = "ps3_system",24};2526/* FIXME: need device usage counters! */27static struct {28struct mutex mutex;29int sb_11; /* usb 0 */30int sb_12; /* usb 0 */31int gpu;32} usage_hack;3334static int ps3_is_device(struct ps3_system_bus_device *dev, u64 bus_id,35u64 dev_id)36{37return dev->bus_id == bus_id && dev->dev_id == dev_id;38}3940static int ps3_open_hv_device_sb(struct ps3_system_bus_device *dev)41{42int result;4344BUG_ON(!dev->bus_id);45mutex_lock(&usage_hack.mutex);4647if (ps3_is_device(dev, 1, 1)) {48usage_hack.sb_11++;49if (usage_hack.sb_11 > 1) {50result = 0;51goto done;52}53}5455if (ps3_is_device(dev, 1, 2)) {56usage_hack.sb_12++;57if (usage_hack.sb_12 > 1) {58result = 0;59goto done;60}61}6263result = lv1_open_device(dev->bus_id, dev->dev_id, 0);6465if (result) {66pr_warn("%s:%d: lv1_open_device dev=%u.%u(%s) failed: %s\n",67__func__, __LINE__, dev->match_id, dev->match_sub_id,68dev_name(&dev->core), ps3_result(result));69result = -EPERM;70}7172done:73mutex_unlock(&usage_hack.mutex);74return result;75}7677static int ps3_close_hv_device_sb(struct ps3_system_bus_device *dev)78{79int result;8081BUG_ON(!dev->bus_id);82mutex_lock(&usage_hack.mutex);8384if (ps3_is_device(dev, 1, 1)) {85usage_hack.sb_11--;86if (usage_hack.sb_11) {87result = 0;88goto done;89}90}9192if (ps3_is_device(dev, 1, 2)) {93usage_hack.sb_12--;94if (usage_hack.sb_12) {95result = 0;96goto done;97}98}99100result = lv1_close_device(dev->bus_id, dev->dev_id);101BUG_ON(result);102103done:104mutex_unlock(&usage_hack.mutex);105return result;106}107108static int ps3_open_hv_device_gpu(struct ps3_system_bus_device *dev)109{110int result;111112mutex_lock(&usage_hack.mutex);113114usage_hack.gpu++;115if (usage_hack.gpu > 1) {116result = 0;117goto done;118}119120result = lv1_gpu_open(0);121122if (result) {123pr_warn("%s:%d: lv1_gpu_open failed: %s\n", __func__,124__LINE__, ps3_result(result));125result = -EPERM;126}127128done:129mutex_unlock(&usage_hack.mutex);130return result;131}132133static int ps3_close_hv_device_gpu(struct ps3_system_bus_device *dev)134{135int result;136137mutex_lock(&usage_hack.mutex);138139usage_hack.gpu--;140if (usage_hack.gpu) {141result = 0;142goto done;143}144145result = lv1_gpu_close();146BUG_ON(result);147148done:149mutex_unlock(&usage_hack.mutex);150return result;151}152153int ps3_open_hv_device(struct ps3_system_bus_device *dev)154{155BUG_ON(!dev);156pr_debug("%s:%d: match_id: %u\n", __func__, __LINE__, dev->match_id);157158switch (dev->match_id) {159case PS3_MATCH_ID_EHCI:160case PS3_MATCH_ID_OHCI:161case PS3_MATCH_ID_GELIC:162case PS3_MATCH_ID_STOR_DISK:163case PS3_MATCH_ID_STOR_ROM:164case PS3_MATCH_ID_STOR_FLASH:165return ps3_open_hv_device_sb(dev);166167case PS3_MATCH_ID_SOUND:168case PS3_MATCH_ID_GPU:169return ps3_open_hv_device_gpu(dev);170171case PS3_MATCH_ID_AV_SETTINGS:172case PS3_MATCH_ID_SYSTEM_MANAGER:173pr_debug("%s:%d: unsupported match_id: %u\n", __func__,174__LINE__, dev->match_id);175pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,176dev->bus_id);177BUG();178return -EINVAL;179180default:181break;182}183184pr_debug("%s:%d: unknown match_id: %u\n", __func__, __LINE__,185dev->match_id);186BUG();187return -ENODEV;188}189EXPORT_SYMBOL_GPL(ps3_open_hv_device);190191int ps3_close_hv_device(struct ps3_system_bus_device *dev)192{193BUG_ON(!dev);194pr_debug("%s:%d: match_id: %u\n", __func__, __LINE__, dev->match_id);195196switch (dev->match_id) {197case PS3_MATCH_ID_EHCI:198case PS3_MATCH_ID_OHCI:199case PS3_MATCH_ID_GELIC:200case PS3_MATCH_ID_STOR_DISK:201case PS3_MATCH_ID_STOR_ROM:202case PS3_MATCH_ID_STOR_FLASH:203return ps3_close_hv_device_sb(dev);204205case PS3_MATCH_ID_SOUND:206case PS3_MATCH_ID_GPU:207return ps3_close_hv_device_gpu(dev);208209case PS3_MATCH_ID_AV_SETTINGS:210case PS3_MATCH_ID_SYSTEM_MANAGER:211pr_debug("%s:%d: unsupported match_id: %u\n", __func__,212__LINE__, dev->match_id);213pr_debug("%s:%d: bus_id: %llu\n", __func__, __LINE__,214dev->bus_id);215BUG();216return -EINVAL;217218default:219break;220}221222pr_debug("%s:%d: unknown match_id: %u\n", __func__, __LINE__,223dev->match_id);224BUG();225return -ENODEV;226}227EXPORT_SYMBOL_GPL(ps3_close_hv_device);228229#define dump_mmio_region(_a) _dump_mmio_region(_a, __func__, __LINE__)230static void _dump_mmio_region(const struct ps3_mmio_region* r,231const char* func, int line)232{233pr_debug("%s:%d: dev %llu:%llu\n", func, line, r->dev->bus_id,234r->dev->dev_id);235pr_debug("%s:%d: bus_addr %lxh\n", func, line, r->bus_addr);236pr_debug("%s:%d: len %lxh\n", func, line, r->len);237pr_debug("%s:%d: lpar_addr %lxh\n", func, line, r->lpar_addr);238}239240static int ps3_sb_mmio_region_create(struct ps3_mmio_region *r)241{242int result;243u64 lpar_addr;244245result = lv1_map_device_mmio_region(r->dev->bus_id, r->dev->dev_id,246r->bus_addr, r->len, r->page_size, &lpar_addr);247r->lpar_addr = lpar_addr;248249if (result) {250pr_debug("%s:%d: lv1_map_device_mmio_region failed: %s\n",251__func__, __LINE__, ps3_result(result));252r->lpar_addr = 0;253}254255dump_mmio_region(r);256return result;257}258259static int ps3_ioc0_mmio_region_create(struct ps3_mmio_region *r)260{261/* device specific; do nothing currently */262return 0;263}264265int ps3_mmio_region_create(struct ps3_mmio_region *r)266{267return r->mmio_ops->create(r);268}269EXPORT_SYMBOL_GPL(ps3_mmio_region_create);270271static int ps3_sb_free_mmio_region(struct ps3_mmio_region *r)272{273int result;274275dump_mmio_region(r);276result = lv1_unmap_device_mmio_region(r->dev->bus_id, r->dev->dev_id,277r->lpar_addr);278279if (result)280pr_debug("%s:%d: lv1_unmap_device_mmio_region failed: %s\n",281__func__, __LINE__, ps3_result(result));282283r->lpar_addr = 0;284return result;285}286287static int ps3_ioc0_free_mmio_region(struct ps3_mmio_region *r)288{289/* device specific; do nothing currently */290return 0;291}292293294int ps3_free_mmio_region(struct ps3_mmio_region *r)295{296return r->mmio_ops->free(r);297}298299EXPORT_SYMBOL_GPL(ps3_free_mmio_region);300301static const struct ps3_mmio_region_ops ps3_mmio_sb_region_ops = {302.create = ps3_sb_mmio_region_create,303.free = ps3_sb_free_mmio_region304};305306static const struct ps3_mmio_region_ops ps3_mmio_ioc0_region_ops = {307.create = ps3_ioc0_mmio_region_create,308.free = ps3_ioc0_free_mmio_region309};310311int ps3_mmio_region_init(struct ps3_system_bus_device *dev,312struct ps3_mmio_region *r, unsigned long bus_addr, unsigned long len,313enum ps3_mmio_page_size page_size)314{315r->dev = dev;316r->bus_addr = bus_addr;317r->len = len;318r->page_size = page_size;319switch (dev->dev_type) {320case PS3_DEVICE_TYPE_SB:321r->mmio_ops = &ps3_mmio_sb_region_ops;322break;323case PS3_DEVICE_TYPE_IOC0:324r->mmio_ops = &ps3_mmio_ioc0_region_ops;325break;326default:327BUG();328return -EINVAL;329}330return 0;331}332EXPORT_SYMBOL_GPL(ps3_mmio_region_init);333334static int ps3_system_bus_match(struct device *_dev,335const struct device_driver *_drv)336{337int result;338const struct ps3_system_bus_driver *drv = ps3_drv_to_system_bus_drv(_drv);339struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);340341if (!dev->match_sub_id)342result = dev->match_id == drv->match_id;343else344result = dev->match_sub_id == drv->match_sub_id &&345dev->match_id == drv->match_id;346347if (result)348pr_info("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): match\n",349__func__, __LINE__,350dev->match_id, dev->match_sub_id, dev_name(&dev->core),351drv->match_id, drv->match_sub_id, drv->core.name);352else353pr_debug("%s:%d: dev=%u.%u(%s), drv=%u.%u(%s): miss\n",354__func__, __LINE__,355dev->match_id, dev->match_sub_id, dev_name(&dev->core),356drv->match_id, drv->match_sub_id, drv->core.name);357358return result;359}360361static int ps3_system_bus_probe(struct device *_dev)362{363int result = 0;364struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);365struct ps3_system_bus_driver *drv;366367BUG_ON(!dev);368dev_dbg(_dev, "%s:%d\n", __func__, __LINE__);369370drv = ps3_system_bus_dev_to_system_bus_drv(dev);371BUG_ON(!drv);372373if (drv->probe)374result = drv->probe(dev);375else376pr_debug("%s:%d: %s no probe method\n", __func__, __LINE__,377dev_name(&dev->core));378379pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));380return result;381}382383static void ps3_system_bus_remove(struct device *_dev)384{385struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);386struct ps3_system_bus_driver *drv;387388BUG_ON(!dev);389dev_dbg(_dev, "%s:%d\n", __func__, __LINE__);390391drv = ps3_system_bus_dev_to_system_bus_drv(dev);392BUG_ON(!drv);393394if (drv->remove)395drv->remove(dev);396else397dev_dbg(&dev->core, "%s:%d %s: no remove method\n",398__func__, __LINE__, drv->core.name);399400pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));401}402403static void ps3_system_bus_shutdown(struct device *_dev)404{405struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);406struct ps3_system_bus_driver *drv;407408BUG_ON(!dev);409410dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,411dev->match_id);412413if (!dev->core.driver) {414dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,415__LINE__);416return;417}418419drv = ps3_system_bus_dev_to_system_bus_drv(dev);420421BUG_ON(!drv);422423dev_dbg(&dev->core, "%s:%d: %s -> %s\n", __func__, __LINE__,424dev_name(&dev->core), drv->core.name);425426if (drv->shutdown)427drv->shutdown(dev);428else if (drv->remove) {429dev_dbg(&dev->core, "%s:%d %s: no shutdown, calling remove\n",430__func__, __LINE__, drv->core.name);431drv->remove(dev);432} else {433dev_dbg(&dev->core, "%s:%d %s: no shutdown method\n",434__func__, __LINE__, drv->core.name);435BUG();436}437438dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);439}440441static int ps3_system_bus_uevent(const struct device *_dev, struct kobj_uevent_env *env)442{443struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);444445if (add_uevent_var(env, "MODALIAS=ps3:%d:%d", dev->match_id,446dev->match_sub_id))447return -ENOMEM;448return 0;449}450451static ssize_t modalias_show(struct device *_dev, struct device_attribute *a,452char *buf)453{454struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);455456return sysfs_emit(buf, "ps3:%d:%d\n", dev->match_id,457dev->match_sub_id);458}459static DEVICE_ATTR_RO(modalias);460461static struct attribute *ps3_system_bus_dev_attrs[] = {462&dev_attr_modalias.attr,463NULL,464};465ATTRIBUTE_GROUPS(ps3_system_bus_dev);466467static const struct bus_type ps3_system_bus_type = {468.name = "ps3_system_bus",469.match = ps3_system_bus_match,470.uevent = ps3_system_bus_uevent,471.probe = ps3_system_bus_probe,472.remove = ps3_system_bus_remove,473.shutdown = ps3_system_bus_shutdown,474.dev_groups = ps3_system_bus_dev_groups,475};476477static int __init ps3_system_bus_init(void)478{479int result;480481if (!firmware_has_feature(FW_FEATURE_PS3_LV1))482return -ENODEV;483484pr_debug(" -> %s:%d\n", __func__, __LINE__);485486mutex_init(&usage_hack.mutex);487488result = device_register(&ps3_system_bus);489BUG_ON(result);490491result = bus_register(&ps3_system_bus_type);492BUG_ON(result);493494pr_debug(" <- %s:%d\n", __func__, __LINE__);495return result;496}497498core_initcall(ps3_system_bus_init);499500/* Allocates a contiguous real buffer and creates mappings over it.501* Returns the virtual address of the buffer and sets dma_handle502* to the dma address (mapping) of the first page.503*/504static void * ps3_alloc_coherent(struct device *_dev, size_t size,505dma_addr_t *dma_handle, gfp_t flag,506unsigned long attrs)507{508int result;509struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);510unsigned long virt_addr;511512flag &= ~(__GFP_DMA | __GFP_HIGHMEM);513flag |= __GFP_ZERO;514515virt_addr = __get_free_pages(flag, get_order(size));516517if (!virt_addr) {518pr_debug("%s:%d: get_free_pages failed\n", __func__, __LINE__);519goto clean_none;520}521522result = ps3_dma_map(dev->d_region, virt_addr, size, dma_handle,523CBE_IOPTE_PP_W | CBE_IOPTE_PP_R |524CBE_IOPTE_SO_RW | CBE_IOPTE_M);525526if (result) {527pr_debug("%s:%d: ps3_dma_map failed (%d)\n",528__func__, __LINE__, result);529BUG_ON("check region type");530goto clean_alloc;531}532533return (void*)virt_addr;534535clean_alloc:536free_pages(virt_addr, get_order(size));537clean_none:538dma_handle = NULL;539return NULL;540}541542static void ps3_free_coherent(struct device *_dev, size_t size, void *vaddr,543dma_addr_t dma_handle, unsigned long attrs)544{545struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);546547ps3_dma_unmap(dev->d_region, dma_handle, size);548free_pages((unsigned long)vaddr, get_order(size));549}550551/* Creates TCEs for a user provided buffer. The user buffer must be552* contiguous real kernel storage (not vmalloc). The address passed here553* is physical address to that hat page. The dma_addr_t returned will point554* to the same byte within the page as was passed in.555*/556557static dma_addr_t ps3_sb_map_phys(struct device *_dev, phys_addr_t phys,558size_t size, enum dma_data_direction direction, unsigned long attrs)559{560struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);561int result;562dma_addr_t bus_addr;563void *ptr = phys_to_virt(phys);564565if (unlikely(attrs & DMA_ATTR_MMIO))566return DMA_MAPPING_ERROR;567568result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,569&bus_addr,570CBE_IOPTE_PP_R | CBE_IOPTE_PP_W |571CBE_IOPTE_SO_RW | CBE_IOPTE_M);572573if (result) {574pr_debug("%s:%d: ps3_dma_map failed (%d)\n",575__func__, __LINE__, result);576}577578return bus_addr;579}580581static dma_addr_t ps3_ioc0_map_phys(struct device *_dev, phys_addr_t phys,582size_t size,583enum dma_data_direction direction,584unsigned long attrs)585{586struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);587int result;588dma_addr_t bus_addr;589u64 iopte_flag;590void *ptr = phys_to_virt(phys);591592if (unlikely(attrs & DMA_ATTR_MMIO))593return DMA_MAPPING_ERROR;594595iopte_flag = CBE_IOPTE_M;596switch (direction) {597case DMA_BIDIRECTIONAL:598iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW;599break;600case DMA_TO_DEVICE:601iopte_flag |= CBE_IOPTE_PP_R | CBE_IOPTE_SO_R;602break;603case DMA_FROM_DEVICE:604iopte_flag |= CBE_IOPTE_PP_W | CBE_IOPTE_SO_RW;605break;606default:607/* not happened */608BUG();609}610result = ps3_dma_map(dev->d_region, (unsigned long)ptr, size,611&bus_addr, iopte_flag);612613if (result) {614pr_debug("%s:%d: ps3_dma_map failed (%d)\n",615__func__, __LINE__, result);616}617return bus_addr;618}619620static void ps3_unmap_phys(struct device *_dev, dma_addr_t dma_addr,621size_t size, enum dma_data_direction direction, unsigned long attrs)622{623struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);624int result;625626result = ps3_dma_unmap(dev->d_region, dma_addr, size);627628if (result) {629pr_debug("%s:%d: ps3_dma_unmap failed (%d)\n",630__func__, __LINE__, result);631}632}633634static int ps3_sb_map_sg(struct device *_dev, struct scatterlist *sgl,635int nents, enum dma_data_direction direction, unsigned long attrs)636{637#if defined(CONFIG_PS3_DYNAMIC_DMA)638BUG_ON("do");639return -EPERM;640#else641struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);642struct scatterlist *sg;643int i;644645for_each_sg(sgl, sg, nents, i) {646int result = ps3_dma_map(dev->d_region, sg_phys(sg),647sg->length, &sg->dma_address, 0);648649if (result) {650pr_debug("%s:%d: ps3_dma_map failed (%d)\n",651__func__, __LINE__, result);652return -EINVAL;653}654655sg->dma_length = sg->length;656}657658return nents;659#endif660}661662static int ps3_ioc0_map_sg(struct device *_dev, struct scatterlist *sg,663int nents,664enum dma_data_direction direction,665unsigned long attrs)666{667BUG();668return -EINVAL;669}670671static void ps3_sb_unmap_sg(struct device *_dev, struct scatterlist *sg,672int nents, enum dma_data_direction direction, unsigned long attrs)673{674#if defined(CONFIG_PS3_DYNAMIC_DMA)675BUG_ON("do");676#endif677}678679static void ps3_ioc0_unmap_sg(struct device *_dev, struct scatterlist *sg,680int nents, enum dma_data_direction direction,681unsigned long attrs)682{683BUG();684}685686static int ps3_dma_supported(struct device *_dev, u64 mask)687{688return mask >= DMA_BIT_MASK(32);689}690691static const struct dma_map_ops ps3_sb_dma_ops = {692.alloc = ps3_alloc_coherent,693.free = ps3_free_coherent,694.map_sg = ps3_sb_map_sg,695.unmap_sg = ps3_sb_unmap_sg,696.dma_supported = ps3_dma_supported,697.map_phys = ps3_sb_map_phys,698.unmap_phys = ps3_unmap_phys,699.mmap = dma_common_mmap,700.get_sgtable = dma_common_get_sgtable,701.alloc_pages_op = dma_common_alloc_pages,702.free_pages = dma_common_free_pages,703};704705static const struct dma_map_ops ps3_ioc0_dma_ops = {706.alloc = ps3_alloc_coherent,707.free = ps3_free_coherent,708.map_sg = ps3_ioc0_map_sg,709.unmap_sg = ps3_ioc0_unmap_sg,710.dma_supported = ps3_dma_supported,711.map_phys = ps3_ioc0_map_phys,712.unmap_phys = ps3_unmap_phys,713.mmap = dma_common_mmap,714.get_sgtable = dma_common_get_sgtable,715.alloc_pages_op = dma_common_alloc_pages,716.free_pages = dma_common_free_pages,717};718719/**720* ps3_system_bus_release_device - remove a device from the system bus721*/722723static void ps3_system_bus_release_device(struct device *_dev)724{725struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);726kfree(dev);727}728729/**730* ps3_system_bus_device_register - add a device to the system bus731*732* ps3_system_bus_device_register() expects the dev object to be allocated733* dynamically by the caller. The system bus takes ownership of the dev734* object and frees the object in ps3_system_bus_release_device().735*/736737int ps3_system_bus_device_register(struct ps3_system_bus_device *dev)738{739int result;740static unsigned int dev_ioc0_count;741static unsigned int dev_sb_count;742static unsigned int dev_vuart_count;743static unsigned int dev_lpm_count;744745if (!dev->core.parent)746dev->core.parent = &ps3_system_bus;747dev->core.bus = &ps3_system_bus_type;748dev->core.release = ps3_system_bus_release_device;749750switch (dev->dev_type) {751case PS3_DEVICE_TYPE_IOC0:752dev->core.dma_ops = &ps3_ioc0_dma_ops;753dev_set_name(&dev->core, "ioc0_%02x", ++dev_ioc0_count);754break;755case PS3_DEVICE_TYPE_SB:756dev->core.dma_ops = &ps3_sb_dma_ops;757dev_set_name(&dev->core, "sb_%02x", ++dev_sb_count);758759break;760case PS3_DEVICE_TYPE_VUART:761dev_set_name(&dev->core, "vuart_%02x", ++dev_vuart_count);762break;763case PS3_DEVICE_TYPE_LPM:764dev_set_name(&dev->core, "lpm_%02x", ++dev_lpm_count);765break;766default:767BUG();768}769770dev->core.of_node = NULL;771set_dev_node(&dev->core, 0);772773pr_debug("%s:%d add %s\n", __func__, __LINE__, dev_name(&dev->core));774775result = device_register(&dev->core);776return result;777}778779EXPORT_SYMBOL_GPL(ps3_system_bus_device_register);780781int ps3_system_bus_driver_register(struct ps3_system_bus_driver *drv)782{783int result;784785pr_debug(" -> %s:%d: %s\n", __func__, __LINE__, drv->core.name);786787if (!firmware_has_feature(FW_FEATURE_PS3_LV1))788return -ENODEV;789790drv->core.bus = &ps3_system_bus_type;791792result = driver_register(&drv->core);793pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, drv->core.name);794return result;795}796797EXPORT_SYMBOL_GPL(ps3_system_bus_driver_register);798799void ps3_system_bus_driver_unregister(struct ps3_system_bus_driver *drv)800{801pr_debug(" -> %s:%d: %s\n", __func__, __LINE__, drv->core.name);802driver_unregister(&drv->core);803pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, drv->core.name);804}805806EXPORT_SYMBOL_GPL(ps3_system_bus_driver_unregister);807808809