SuperH Interfaces Guide
Author: Paul Mundt
- DeviceTree Booting
- Adding a new board to LinuxSH
- Notes on register bank usage in the kernel
- features
Memory Management #
SH-4 #
Store Queue API #
sq_flush_range() #
void Flush (prefetch) a specific SQ range
Parameters
unsigned long start: the store queue address to start flushing fromunsigned int len: the length to flush
Description
Flushes the store queue cache from start to start + len in a linear fashion.
sq_remap() #
unsigned long Map a physical address through the Store Queues
Parameters
unsigned long phys: Physical address of mapping.unsigned int size: Length of mapping.const char *name: User invoking mapping.pgprot_t prot: Protection 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.
sq_unmap() #
void Unmap a Store Queue allocation
Parameters
unsigned long vaddr: Pre-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 #
aica_rtc_gettimeofday() #
int Get the time from the AICA RTC
Parameters
struct device *dev: the RTC device (ignored)struct rtc_time *tm: pointer to resulting RTC time structure
Description
Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.
aica_rtc_settimeofday() #
int Set the AICA RTC to the current time
Parameters
struct device *dev: the RTC device (ignored)struct rtc_time *tm: pointer to new RTC time structure
Description
Adjusts the given tv to the AICA Epoch and sets the RTC seconds counter.
mach-x3proto #
ilsel_enable() #
int Enable an ILSEL set.
Parameters
ilsel_source_t set: ILSEL 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().
ilsel_enable_fixed() #
int Enable an ILSEL set at a fixed interrupt level
Parameters
ilsel_source_t set: ILSEL source (see ilsel_source_t enum in include/asm-sh/ilsel.h).unsigned int level: Interrupt 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()).
ilsel_disable() #
void Disable an ILSEL set
Parameters
unsigned int irq: Bit position for ILSEL set value (retval from enable routines)
Description
Disable a previously enabled ILSEL set.
Busses #
Maple #
maple_driver_register() #
int register a maple driver
Parameters
struct maple_driver *drv: maple driver to be registered.
Description
Registers the passed in drv, while updating the bus type. Devices with matching function IDs will be automatically probed.
maple_driver_unregister() #
void unregister a maple driver.
Parameters
struct maple_driver *drv: maple driver to unregister.
Description
Cleans up after maple_driver_register(). To be invoked in the exit
path of any module drivers.
maple_getcond_callback() #
void setup handling MAPLE_COMMAND_GETCOND
Parameters
struct maple_device *dev: device respondingvoid (*callback) (struct mapleq *mq): handler callbackunsigned long interval: interval in jiffies between callbacksunsigned long function: the function code for the device
maple_add_packet() #
int add a single instruction to the maple bus queue
Parameters
struct maple_device *mdev: maple deviceu32 function: function on device being queriedu32 command: maple command to addsize_t length: length of command string (in 32 bit words)void *data: remainder of command string