Skip to content

Commit

Permalink
[POWERPC] PS3: Repository probe cleanups
Browse files Browse the repository at this point in the history
Repository updates:
  - Extract ps3_repository_find_bus() from ps3_repository_find_device(), as the
    storage driver needs it.
  - Make ps3_repository_find_device() return -ENODEV if a device is not found,
    just like if a bus is not found.
  - Add ps3_repository_read_vuart_sysmgr_port() and
    ps3_repository_read_vuart_av_port() to get vuart port info.
  - Add device enumeration routines ps3_repository_find_device() and
    ps3_repository_find_devices().
  - Cleanup debug routines.

Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Geoff Levand authored and Paul Mackerras committed Jun 28, 2007
1 parent 6758555 commit a3323d1
Show file tree
Hide file tree
Showing 2 changed files with 337 additions and 280 deletions.
31 changes: 20 additions & 11 deletions arch/powerpc/platforms/ps3/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,24 +131,28 @@ int ps3_repository_read_dev_reg(unsigned int bus_index,
/* repository bus enumerators */

struct ps3_repository_device {
enum ps3_bus_type bus_type;
unsigned int bus_index;
unsigned int bus_id;
enum ps3_dev_type dev_type;
unsigned int dev_index;
struct ps3_device_id did;
unsigned int dev_id;
};

int ps3_repository_find_device(enum ps3_bus_type bus_type,
enum ps3_dev_type dev_type,
const struct ps3_repository_device *start_dev,
struct ps3_repository_device *dev);
static inline int ps3_repository_find_first_device(
enum ps3_bus_type bus_type, enum ps3_dev_type dev_type,
struct ps3_repository_device *dev)
static inline struct ps3_repository_device *ps3_repository_bump_device(
struct ps3_repository_device *repo)
{
return ps3_repository_find_device(bus_type, dev_type, NULL, dev);
repo->dev_index++;
return repo;
}
int ps3_repository_find_interrupt(const struct ps3_repository_device *dev,
int ps3_repository_find_device(struct ps3_repository_device *repo);
int ps3_repository_find_devices(enum ps3_bus_type bus_type,
int (*callback)(const struct ps3_repository_device *repo));
int ps3_repository_find_bus(enum ps3_bus_type bus_type, unsigned int from,
unsigned int *bus_index);
int ps3_repository_find_interrupt(const struct ps3_repository_device *repo,
enum ps3_interrupt_type intr_type, unsigned int *interrupt_id);
int ps3_repository_find_reg(const struct ps3_repository_device *dev,
int ps3_repository_find_reg(const struct ps3_repository_device *repo,
enum ps3_reg_type reg_type, u64 *bus_addr, u64 *len);

/* repository block device info */
Expand Down Expand Up @@ -218,6 +222,11 @@ int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id);
int ps3_repository_read_spu_resource_id(unsigned int res_index,
enum ps3_spu_resource_type* resource_type, unsigned int *resource_id);

/* repository vuart info */

int ps3_repository_read_vuart_av_port(unsigned int *port);
int ps3_repository_read_vuart_sysmgr_port(unsigned int *port);

/* Page table entries */
#define IOPTE_PP_W 0x8000000000000000ul /* protection: write */
#define IOPTE_PP_R 0x4000000000000000ul /* protection: read */
Expand Down
Loading

0 comments on commit a3323d1

Please sign in to comment.