SuperH Interfaces Guide¶
- Author
Paul Mundt
Memory Management¶
SH-4¶
Store Queue API¶
-
void
sq_flush_range(unsigned long start, unsigned int len)¶ Flush (prefetch) a specific SQ range
Parameters
unsigned long startthe store queue address to start flushing from
unsigned int lenthe length to flush
Description
Flushes the store queue cache from start to start + len in a linear fashion.
-
unsigned long
sq_remap(unsigned long phys, unsigned int size, const char *name, pgprot_t prot)¶ Map a physical address through the Store Queues
Parameters
unsigned long physPhysical address of mapping.
unsigned int sizeLength of mapping.
const char *nameUser invoking mapping.
pgprot_t protProtection bits.
Description
Remaps the physical address phys through the next available store queue address of size length. name is logged at boot time as well as through the sysfs interface.
-
void
sq_unmap(unsigned long vaddr)¶ Unmap a Store Queue allocation
Parameters
unsigned long vaddrPre-allocated Store Queue mapping.
Description
Unmaps the store queue allocation map that was previously created by
sq_remap(). Also frees up the pte that was previously inserted into
the kernel page table and discards the UTLB translation.
Machine Specific Interfaces¶
mach-dreamcast¶
Parameters
struct device *devthe RTC device (ignored)
struct rtc_time *tmpointer to resulting RTC time structure
Description
Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
-
int
aica_rtc_settimeofday(struct device *dev, struct rtc_time *tm)¶ Set the AICA RTC to the current time
Parameters
struct device *devthe RTC device (ignored)
struct rtc_time *tmpointer to new RTC time structure
Description
Adjusts the given tv to the AICA Epoch and sets the RTC seconds counter.
mach-x3proto¶
-
int
ilsel_enable(ilsel_source_t set)¶ Enable an ILSEL set.
Parameters
ilsel_source_t setILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
Description
Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highest
available interrupt level. Callers should take care to order callsites
noting descending interrupt levels. Aliasing FPGA and external board
IRQs need to use ilsel_enable_fixed().
The return value is an IRQ number that can later be taken down with
ilsel_disable().
-
int
ilsel_enable_fixed(ilsel_source_t set, unsigned int level)¶ Enable an ILSEL set at a fixed interrupt level
Parameters
ilsel_source_t setILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).
unsigned int levelInterrupt level (1 - 15)
Description
Enables a given ILSEL source at a fixed interrupt level. Necessary both for level reservation as well as for aliased sources that only exist on special ILSEL#s.
Returns an IRQ number (as ilsel_enable()).
-
void
ilsel_disable(unsigned int irq)¶ Disable an ILSEL set
Parameters
unsigned int irqBit position for ILSEL set value (retval from enable routines)
Description
Disable a previously enabled ILSEL set.
Busses¶
SuperHyway¶
-
int
superhyway_add_device(unsigned long base, struct superhyway_device *sdev, struct superhyway_bus *bus)¶ Add a SuperHyway module
Parameters
unsigned long basePhysical address where module is mapped.
struct superhyway_device *sdevSuperHyway device to add, or NULL to allocate a new one.
struct superhyway_bus *busBus where SuperHyway module resides.
Description
This is responsible for adding a new SuperHyway module. This sets up a new struct superhyway_device for the module being added if sdev == NULL.
Devices are initially added in the order that they are scanned (from the top-down of the memory map), and are assigned an ID based on the order that they are added. Any manual addition of a module will thus get the ID after the devices already discovered regardless of where it resides in memory.
Further work can and should be done in superhyway_scan_bus(), to be sure that any new modules are properly discovered and subsequently registered.
-
int
superhyway_register_driver(struct superhyway_driver *drv)¶ Register a new SuperHyway driver
Parameters
struct superhyway_driver *drvSuperHyway driver to register.
Description
This registers the passed in drv. Any devices matching the id table will automatically be populated and handed off to the driver’s specified probe routine.
-
void
superhyway_unregister_driver(struct superhyway_driver *drv)¶ Unregister a SuperHyway driver
Parameters
struct superhyway_driver *drvSuperHyway driver to unregister.
Description
This cleans up after superhyway_register_driver(), and should be invoked in
the exit path of any module drivers.
Maple¶
-
int
maple_driver_register(struct maple_driver *drv)¶ register a maple driver
Parameters
struct maple_driver *drvmaple driver to be registered.
Description
Registers the passed in drv, while updating the bus type. Devices with matching function IDs will be automatically probed.
-
void
maple_driver_unregister(struct maple_driver *drv)¶ unregister a maple driver.
Parameters
struct maple_driver *drvmaple driver to unregister.
Description
Cleans up after maple_driver_register(). To be invoked in the exit
path of any module drivers.
-
void
maple_getcond_callback(struct maple_device *dev, void (*callback)(struct mapleq *mq), unsigned long interval, unsigned long function, )¶ setup handling MAPLE_COMMAND_GETCOND
Parameters
struct maple_device *devdevice responding
void (*callback) (struct mapleq *mq)handler callback
unsigned long intervalinterval in jiffies between callbacks
unsigned long functionthe function code for the device
-
int
maple_add_packet(struct maple_device *mdev, u32 function, u32 command, size_t length, void *data)¶ add a single instruction to the maple bus queue
Parameters
struct maple_device *mdevmaple device
u32 functionfunction on device being queried
u32 commandmaple command to add
size_t lengthlength of command string (in 32 bit words)
void *dataremainder of command string