SuperH Interfaces Guide

Author:

Paul Mundt

Memory Management

SH-4

Store Queue API

voidsq_flush_range(unsignedlongstart,unsignedintlen)

Flush (prefetch) a specific SQ range

Parameters

unsignedlongstart

the store queue address to start flushing from

unsignedintlen

the length to flush

Description

Flushes the store queue cache fromstart tostart +len in alinear fashion.

unsignedlongsq_remap(unsignedlongphys,unsignedintsize,constchar*name,pgprot_tprot)

Map a physical address through the Store Queues

Parameters

unsignedlongphys

Physical address of mapping.

unsignedintsize

Length of mapping.

constchar*name

User invoking mapping.

pgprot_tprot

Protection bits.

Description

Remaps the physical addressphys through the next available store queueaddress ofsize length.name is logged at boot time as well as throughthe sysfs interface.

voidsq_unmap(unsignedlongvaddr)

Unmap a Store Queue allocation

Parameters

unsignedlongvaddr

Pre-allocated Store Queue mapping.

Description

Unmaps the store queue allocationmap that was previously created bysq_remap(). Also frees up the pte that was previously inserted intothe kernel page table and discards the UTLB translation.

Machine Specific Interfaces

mach-dreamcast

intaica_rtc_gettimeofday(structdevice*dev,structrtc_time*tm)

Get the time from the AICA RTC

Parameters

structdevice*dev

the RTC device (ignored)

structrtc_time*tm

pointer to resulting RTC time structure

Description

Grabs the current RTC seconds counter and adjusts it to the Unix Epoch.

intaica_rtc_settimeofday(structdevice*dev,structrtc_time*tm)

Set the AICA RTC to the current time

Parameters

structdevice*dev

the RTC device (ignored)

structrtc_time*tm

pointer to new RTC time structure

Description

Adjusts the giventv to the AICA Epoch and sets the RTC seconds counter.

mach-x3proto

intilsel_enable(ilsel_source_tset)

Enable an ILSEL set.

Parameters

ilsel_source_tset

ILSEL source (see ilsel_source_tenumin include/asm-sh/ilsel.h).

Description

Enables a given non-aliased ILSEL source (<= ILSEL_KEY) at the highestavailable interrupt level. Callers should take care to order callsitesnoting descending interrupt levels. Aliasing FPGA and external boardIRQs need to useilsel_enable_fixed().

The return value is an IRQ number that can later be taken down withilsel_disable().

intilsel_enable_fixed(ilsel_source_tset,unsignedintlevel)

Enable an ILSEL set at a fixed interrupt level

Parameters

ilsel_source_tset

ILSEL source (see ilsel_source_tenumin include/asm-sh/ilsel.h).

unsignedintlevel

Interrupt level (1 - 15)

Description

Enables a given ILSEL source at a fixed interrupt level. Necessaryboth for level reservation as well as for aliased sources that onlyexist on special ILSEL#s.

Returns an IRQ number (asilsel_enable()).

voidilsel_disable(unsignedintirq)

Disable an ILSEL set

Parameters

unsignedintirq

Bit position for ILSEL set value (retval from enable routines)

Description

Disable a previously enabled ILSEL set.

Busses

Maple

intmaple_driver_register(structmaple_driver*drv)

register a maple driver

Parameters

structmaple_driver*drv

maple driver to be registered.

Description

Registers the passed indrv, while updating the bus type.Devices with matching function IDs will be automatically probed.

voidmaple_driver_unregister(structmaple_driver*drv)

unregister a maple driver.

Parameters

structmaple_driver*drv

maple driver to unregister.

Description

Cleans up aftermaple_driver_register(). To be invoked in the exitpath of any module drivers.

voidmaple_getcond_callback(structmaple_device*dev,void(*callback)(structmapleq*mq),unsignedlonginterval,unsignedlongfunction)

setup handling MAPLE_COMMAND_GETCOND

Parameters

structmaple_device*dev

device responding

void(*callback)(structmapleq*mq)

handler callback

unsignedlonginterval

interval in jiffies between callbacks

unsignedlongfunction

the function code for the device

intmaple_add_packet(structmaple_device*mdev,u32function,u32command,size_tlength,void*data)

add a single instruction to the maple bus queue

Parameters

structmaple_device*mdev

maple device

u32function

function on device being queried

u32command

maple command to add

size_tlength

length of command string (in 32 bit words)

void*data

remainder of command string