Introduction
This module provides support for portable machines. The SWIs listed are not normally intended to be issued from user programs, they will normally be issued by other modules in the system.
Service Calls
| R1 | = | &8A (service number) | ||||||||||||||||
| R2 | = | Sub-reason code:
| ||||||||||||||||
| R3 | = | Bit mask of which ports are being powered down (if R2 = 0) (each bit set indicates port is being powered down) or bit mask of which ports have been powered up (if R2 = 1) (each bit set indicates port has been powered up) |
| R1 | = | 0 if R3 = 0, else preserved to pass on |
| R2 | = | Preserved |
| R3 | = | Bit mask of which ports may be powered down or up (each bit set indicates no objection to change of state) |
This call is issued before power is removed or after power is reapplied to the following:
- Econet (bit 0)
- serial buffer/oscillator (bit 3)
- FDC oscillator (bit 14)
If a module wishes to prevent hardware being powered down it should clear the appropriate bit or bits in R3. In addition, if the resulting value in R3 is now zero, the module should claim the service by setting R1 to zero. (This is to prevent the call being unnecessarily passed round the rest of the modules). Otherwise the service should be passed on by preserving R1.
This service call should never be claimed.
| R1 | = | &8A (service number) |
| R2 | = | Sub-reason code (0) |
| R3 | = | Bit mask of which ports are being powered down (each bit set indicates port is being powered down) |
| R1 | = | 0 if R3 = 0, else preserved to pass on |
| R2 | = | Preserved |
| R3 | = | Bit mask of which ports may be powered down (each bit set indicates no objection to change of state) |
This call is issued before power is removed from the following:
- Econet (bit 0)
- serial buffer/oscillator (bit 3)
- FDC oscillator (bit 14)
If a module wishes to prevent hardware being powered down it should clear the appropriate bit or bits in R3. In addition, if the resulting value in R3 is now zero, the module should claim the service by setting R1 to zero. (This is to prevent the call being unnecessarily passed round the rest of the modules). Otherwise the service should be passed on by preserving R1.
This service call should never be claimed.
| R1 | = | &8A (service number) |
| R2 | = | Sub-reason code (1) |
| R3 | = | Bit mask of which ports have been powered up (each bit set indicates port has been powered up) |
| R1 | = | 0 if R3 = 0, else preserved to pass on |
| R2 | = | Preserved |
| R3 | = | Preserved |
This call is issued after power is reapplied to the following:
- Econet (bit 0)
- serial buffer/oscillator (bit 3)
- FDC oscillator (bit 14)
The service should be passed on by preserving R1.
| R1 | = | &8A (service number) |
| R2 | = | Sub-reason code (3) |
| R1 - R2 | = | Preserved |
This call is issued before the device is put into a stopped mode where the CPU core has been disabled. RAM continues to be refreshed and the system will probably be woken up at some future point. It is possible that the power may fail on the device before it is awakened. In such cases, the device may next be activated from a hard reset condition.
| R1 | = | &8A (service number) | ||||||||||||||||||
| R2 | = | Sub-reason code (4) | ||||||||||||||||||
| R3 | = | Failure code:
|
| R1 - R3 | = | Preserved |
This call is issued after the device returns from a stopped state. It may never have physically stopped the CPU if some part of the system failed to be shut down. In such cases, it may not be necessary to fully resynchronise the environment - for example, network connections may still be active.
| R1 | = | &8A (service number) |
| R2 | = | Sub-reason code (5) |
| R1 | = | 0 if call is being claimed to prevent freeze, preserved to accept freeze |
| R2 | = | Preserved |
This call is issued before the device is stopped. Any module wishing to object to the request may claim the service.
SWI Calls
| R0 | = | EOR mask |
| R1 | = | AND mask |
| R0 | = | Old speed | ||||||
| R1 | = | New speed:
|
This SWI controls the processor speed, which is reduced when the system is idle in order to save power.
The new speed is calculated as follows:
new speed = (old speed AND R1) EOR R0
| R0 | = | EOR mask |
| R1 | = | AND mask |
| R0 | = | Old control |
| R1 | = | New control |
This SWI controls various power control and miscellaneous bits in the portable machine.
The new control is calculated as follows:
new control = (old control AND R1) EOR R0
The bits in control are as follows:
| Bit(s) | Meaning | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Power to Econet enabled | |||||||||||
| 1 | Power to LCD display enabled | |||||||||||
| 2 | Power to external video display enabled | |||||||||||
| 3 | Power to serial buffer and oscillator enabled | |||||||||||
| 4 | Dual panel mode enabled | |||||||||||
| 5-6 | Video clock control:
| |||||||||||
| 7 | Invert video clock | |||||||||||
| 8 | Back-light enabled | |||||||||||
| 9 | Set: 2 extra lines on display. Clear: 1 extra line on display | |||||||||||
| 10 | Set: 2 DRAMs used for dual panel. Clear: 1 DRAM used for dual panel | |||||||||||
| 11-13 | Reserved | |||||||||||
| 14 | Power to FDC oscillator enabled | |||||||||||
| 15 | Reserved | |||||||||||
| 16 | LCD palette set up for inverse video | |||||||||||
| 17 | Internal tracker ball enabled | |||||||||||
| 18 | External mouse enabled | |||||||||||
| 19 | Power to external keyboard and mouse enabled | |||||||||||
| 20-31 | Reserved | |||||||||||
Reserved bits must not be modified, nor assumed to read any particular value.
Note that the 82C711 has one oscillator which is used by the serial sub-unit and by the floppy disc controller (FDC). Power to the oscillator is removed only if bits 3 and 14 are both clear.
On some computers the power to the oscillator cannot be removed because the same oscillator drives other parts of the system (eg IOEB).
If this call results in bits 0, 3 or 14 changing (i.e. power being removed or applied to the serial buffer/oscillator, Econet or FDC oscillator), then Service_Portable 0 is issued (see Service_Portable 1).
| R0 | = | BMU variable number |
| R0 | = | Preserved |
| R1 | = | Value of variable |
This SWI reads Battery Management Unit variables. Any variable which is not supported will return an error.
The BMU variable numbers are:
| Variable | Read/Write | Description |
|---|---|---|
| 0 | R | Version number and memory map of BMU microcode |
| 1 | R | Nominal battery capacity |
| 2 | R | Measured battery capacity |
| 3 | R | Used battery capacity |
| 4 | R | Usable battery capacity |
| 5 | R | Reserved |
| 6 | R/W | Charge estimate |
| 7 | R | Instantaneous voltage |
| 8 | R | Instantaneous current |
| 9 | R | Instantaneous temperature |
| 10 | R | Flag bits (see below) |
| 11 | R | Charge rate (bits 4 to 7) |
| 12 | R | Charge current |
| 13 | R | Discharge current |
| 14 | R | Voltage |
| 15 | R | Temperature 1 |
| 16 | R | Temperature 2 |
| 17 | R | Charge level |
| 18 | R | Status flags (as variable 10) |
| 19 | R | Input signals |
| 20 | R | Battery capacity |
| 21 | R | Battery time remaining in seconds |
| 22 | R | Maximum battery life in seconds |
The flag bits of variable 10 are:
| Bit(s) | Meaning | |
|---|---|---|
| 0 | Battery has been replaced | |
| 1 | Lid is open | |
| 2 | Threshold 2 reached (battery is flat) | |
| 3 | Threshold 1 reached (battery is low) | |
| 4 | Charging system fault | |
| 5 | Charge state is known | |
| 6 | Battery present (set when battery is present, whether in use, charging or idle) | |
| 7 | Power connected (set when external power is available, whether charging or not) | |
Reading any variable except the flags (variable 10) will enable IRQs (the flags are read from a soft copy).
Variables 0-11 were implemented within the A4 version of the Portable module. Variables 12-20 and selected variables from 0-11 were implemented within the Stork version of the Portable module. Variables 21-22 are implemented within the Virtual RiscPC version of the Portable module. Variables 0-4, 10, 11 and 14 are provided by the A9 version of the Portable.
Despite this, clients should not expect any particular variables to be provided by a given implementation as hardware capabilities and software implementation may change. Clients should always attempt to read the value and take appropriate action if a failure occurs.
Variables which are not supported will return with the V flag set and R0 pointing to a standard error block. Applications trying to use the more advanced features and finding they are not available should attempt to fall back to earlier methods.
| R0 | = | BMU variable number |
| R1 | = | New value of variable |
| R0 - R1 | = | Preserved |
This SWI writes Battery Management Unit variables.
The variable numbers are as for Portable_ReadBMUVariable. Variables not marked with a 'W' should not be written.
| R0 | = | Reason code:
| ||||||||||||||||
| R1 - R5 | = | Dependent on reason code |
| R1 - R5 | = | Preserved |
This SWI issues a command to the Battery Management Unit. The values of variables after a command may not change immediately after this command is issued.
| R1 | = | Features of the portable module:
| ||||||||||||||||||
This SWI is used to read the features provided by the Portable module. Where this module is not present, or this SWI generates an error if called, clients should treat the features as being 0.
This SWI places the system into idle mode. The CPU clock is stopped, but all other clocks run normally. This means the Video display and all the IO channels are active, the DRAM is refreshed, but the system consumes less power as the CPU is inactive. The CPU remains in this state until it receives a FIQ or IRQ interrupt (eg from the keyboard, floppy, centi-second timer etc).
Essentially it requests that the environment be stopped until 'something interesting' happens.
| R0 | = | Reason for wake up:
|
This SWI places the machine into a 'standby' state, from which it can be awoken by certain interrupts. DRAM is set to self-refresh, and the system placed into stop mode (all clocks are stopped). Execution continues only on receipt of an external wakeup event from the keyboard or real-time-clock. Normal FIQ or IRQ or centi-second timer events cannot happen because the IO system is not clocked.
Freezing of the machine may be prevented by modules through the service call Service_Portable 5. This service is issued prior to attempts to freeze the machine. If no clients object to this service, Service_Portable 3 will be issued and the machine shut down. Upon an interrupt, Service_Portable 4 will be issued to notify clients that the power has been restored and a period of time has elapsed during which interrupts have not happened.
| R0 | = | Status of the Portable environment:
| ||||||||||||||||||
This SWI is used to read the status of the Portable environment. This allows applications to modify their behaviour, or for modules to configure their operations based on the environment in which the device is situated.