Skip to contentSkip to conversation

PS3: Move system bus to platform directory

PATCH In review Geoff Levand 5 participants 5 messages Jan 30, 2007 – Feb 6, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 PS3: Move system bus to platform directory

Move the PS3 system bus routines from drivers/ps3 to arch/powerpc/platforms/ps3.

---

As requested by Ben and Christoph.

 drivers/ps3/system-bus.c                |  362 -------------------------------
 arch/powerpc/platforms/ps3/Makefile     |    1 
 arch/powerpc/platforms/ps3/htab.c       |    1 
 arch/powerpc/platforms/ps3/interrupt.c  |    1 
 arch/powerpc/platforms/ps3/mm.c         |    1 
 arch/powerpc/platforms/ps3/os-area.c    |    1 
 arch/powerpc/platforms/ps3/platform.h   |  151 +++++++++++++
 arch/powerpc/platforms/ps3/repository.c |    3 
 arch/powerpc/platforms/ps3/setup.c      |    1 
 arch/powerpc/platforms/ps3/smp.c        |    1 
 arch/powerpc/platforms/ps3/spu.c        |    3 
 arch/powerpc/platforms/ps3/system-bus.c |  363 ++++++++++++++++++++++++++++++++
 drivers/ps3/Makefile                    |    1 
 include/asm-powerpc/ps3.h               |  150 -------------
 14 files changed, 519 insertions(+), 521 deletions(-)
arch/powerpc/platforms/ps3/Makefile +1 -0
@@ -1,5 +1,6 @@
 obj-y += setup.o mm.o time.o hvcall.o htab.o repository.o
 obj-y += interrupt.o exports.o os-area.o
+obj-y += system-bus.o
 
 obj-$(CONFIG_SMP) += smp.o
 obj-$(CONFIG_SPU_BASE) += spu.o
arch/powerpc/platforms/ps3/htab.c +0 -1
@@ -23,7 +23,6 @@
 #include <asm/machdep.h>
 #include <asm/lmb.h>
 #include <asm/udbg.h>
-#include <asm/ps3.h>
 #include <asm/lv1call.h>
 
 #include "platform.h"
arch/powerpc/platforms/ps3/interrupt.c +0 -1
@@ -24,7 +24,6 @@
 
 #include <asm/machdep.h>
 #include <asm/udbg.h>
-#include <asm/ps3.h>
 #include <asm/lv1call.h>
 
 #include "platform.h"
arch/powerpc/platforms/ps3/mm.c +0 -1
@@ -25,7 +25,6 @@
 #include <asm/firmware.h>
 #include <asm/lmb.h>
 #include <asm/udbg.h>
-#include <asm/ps3.h>
 #include <asm/lv1call.h>
 
 #include "platform.h"
arch/powerpc/platforms/ps3/os-area.c +0 -1
@@ -22,7 +22,6 @@
 #include <linux/io.h>
 
 #include <asm/lmb.h>
-#include <asm/ps3.h>
 
 #include "platform.h"
 
arch/powerpc/platforms/ps3/platform.h +151 -0

161 lines not on this page · raw message

arch/powerpc/platforms/ps3/repository.c +2 -1
@@ -18,9 +18,10 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <asm/ps3.h>
 #include <asm/lv1call.h>
 
+#include "platform.h"
+
 enum ps3_vendor_id {
 	PS3_VENDOR_ID_NONE = 0,
 	PS3_VENDOR_ID_SONY = 0x8000000000000000UL,
arch/powerpc/platforms/ps3/setup.c +0 -1
@@ -32,7 +32,6 @@
 #include <asm/udbg.h>
 #include <asm/prom.h>
 #include <asm/lv1call.h>
-#include <asm/ps3.h>
 
 #include "platform.h"
 
arch/powerpc/platforms/ps3/smp.c +0 -1
@@ -23,7 +23,6 @@
 
 #include <asm/machdep.h>
 #include <asm/udbg.h>
-#include <asm/ps3.h>
 
 #include "platform.h"
 
arch/powerpc/platforms/ps3/spu.c +2 -1
@@ -26,9 +26,10 @@
 
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
-#include <asm/ps3.h>
 #include <asm/lv1call.h>
 
+#include "platform.h"
+
 /* spu_management_ops */
 
 /**
arch/powerpc/platforms/ps3/system-bus.c new file +363 -0

363 lines not on this page · raw message

drivers/ps3/Makefile +0 -1
@@ -1,2 +1 @@
-obj-y += system-bus.o
 obj-$(CONFIG_PS3_VUART) += vuart.o
drivers/ps3/system-bus.c deleted +0 -362

362 lines not on this page · raw message

include/asm-powerpc/ps3.h +0 -150

162 lines not on this page · raw message

#2 lore raw
In reply to Geoff Levand
Quoted 4 lines · Geoff Levand
arch/powerpc/platforms/ps3/platform.h +0 -0
@@ -22,6 +22,9 @@
 #define _PS3_PLATFORM_H
 
 #include <linux/rtc.h>

arch/powerpc/platforms/ps3/platform.h void ps3_spu_set_platform (void); · line 85

Quoted 10 lines
arch/powerpc/platforms/ps3/platform.h +9 -0
+#include <scsi/scsi.h>
 
+enum ps3_dev_type {
+	PS3_DEV_TYPE_STOR_DISK = TYPE_DISK,	/* 0 */
+	PS3_DEV_TYPE_SB_GELIC = 3,
+	PS3_DEV_TYPE_SB_USB = 4,
+	PS3_DEV_TYPE_STOR_ROM = TYPE_ROM,	/* 5 */
+	PS3_DEV_TYPE_SB_GPIO = 6,
+	PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC,	/* 14 */
+};

I don't think you should take some of the values from the scsi device types but reuse others. Just do an enum of your own and if you ever have to translate to scsi types somewhere use a lookup table.

#3 lore raw
Quoted 7 lines · Christoph Hellwig
Quoted 5 lines · Geoff Levand
arch/powerpc/platforms/ps3/platform.h +1 -0
@@ -22,6 +22,9 @@
 #define _PS3_PLATFORM_H
 
 #include <linux/rtc.h>
+#include <scsi/scsi.h>
Quoted 12 lines

arch/powerpc/platforms/ps3/platform.h void ps3_spu_set_platform (void); · line 85

Quoted 8 lines
arch/powerpc/platforms/ps3/platform.h +8 -0
+enum ps3_dev_type {
+	PS3_DEV_TYPE_STOR_DISK = TYPE_DISK,	/* 0 */
+	PS3_DEV_TYPE_SB_GELIC = 3,
+	PS3_DEV_TYPE_SB_USB = 4,
+	PS3_DEV_TYPE_STOR_ROM = TYPE_ROM,	/* 5 */
+	PS3_DEV_TYPE_SB_GPIO = 6,
+	PS3_DEV_TYPE_STOR_FLASH = TYPE_RBC,	/* 14 */
+};

I don't think you should take some of the values from the scsi device types but reuse others. Just do an enum of your own and if you ever have to translate to scsi types somewhere use a lookup table.

Actually the HyperVisor uses the SCSI values for DISK, ROM, and FLASH. I just wanted to make that clear.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) [email protected] ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium