Commit a8ce4437 authored by Paul Skirrow's avatar Paul Skirrow
Browse files

Added fake podule header for EtherI. Converted to ObjAsm.

Detail:
  The Customer F 5 Ethernet NC doesn't have a podule ROM fitted, so we
  provide a fake podule header in podule manager.
  This is used if FakePodule0 is set in the machine header file
  or if FakePodule is passed in from the Makefile (FakePodule overrides
  the FakePodule0).
  It should be set to ProdType_EtherI to fake an EtherI podule but
  other values are possible, eg for MPEG).
Admin:
  Tested OK in Customer F 5 NC.

Version 1.51. Tagged as 'Podule-1_51'
parent d5e1e870
......@@ -23,8 +23,10 @@
# 28-Jun-94 AMcC Added extra development rules.
# 30-Aug-94 AMcC Added resources: target
# 16-Jan-96 JRH Makes different targets for different machines
#
# 11-Jan-00 PMS Converted to use objasm instead of aasm so that we
# can pass in assembly-time constants to control
# fake podule header for Customer F 5 Ethernet NC
# which doesn't have a podule ROM. Paul Skirrow.
#
# Paths
#
......@@ -34,13 +36,15 @@ EXP_CHDR = <CExport$Dir>.h
#
# Generic options:
#
MKDIR = cdir
AS = aasm
AS = objasm
CP = copy
MODGEN = modgen
LD = link
RM = remove
CCFLAGS = -c -depend !Depend -IC:
ASFLAGS = -depend !Depend -Stamp -quit -module -To $@ -From
ASFLAGS = -depend !Depend -Stamp -quit -module -PreDefine ${OPTIONS} -To $@ -From
CPFLAGS = ~cfr~v
TOKENISE = tokenise
......@@ -50,8 +54,9 @@ TOKENS = Hdr:Tokens
# Program specific options:
#
COMPONENT = Podule
SOURCE = s.GetAll
SOURCE = Commands.s Errors.s GetAll.s HelpTokens.s Interface.s Module.s MsgCode.s ROMExtend.s
TARGET = rm.${MACHINE}.Podule
ROMTARGET = Podule.o
EXPORTS = ${EXP_HDR}.${COMPONENT} \
${EXP_CHDR}.${COMPONENT}
......@@ -94,10 +99,6 @@ clean:
${RM} setversion
@echo ${COMPONENT}: cleaned
${TARGET}: ${SOURCE} s.HelpTokens
${MKDIR} rm.${MACHINE}
${AS} ${ASFLAGS} ${SOURCE}
s.HelpTokens: ${TOKENS} HelpTexts
${TOKENISE} ${TOKENS} HelpTexts $@
......@@ -107,6 +108,25 @@ ${EXP_HDR}.${COMPONENT}: hdr.${COMPONENT}
${EXP_CHDR}.${COMPONENT}: h.${COMPONENT}
${CP} h.${COMPONENT} $@ ${CPFLAGS}
#
# Target
#
${TARGET}: ${SOURCE}
${AS} ${AFLAGS} GetAll.s Podule.o
${MKDIR} rm.${MACHINE}
${LD} -o $@ -bin Podule.o
SetType $@ &FFA
#
# Final link for the ROM Image (using given base address)
#
rom_link:
${MKDIR} linked
${LD} -o linked.${COMPONENT} -bin -base ${ADDRESS} ${ROMTARGET} ${ABSSYM}
SetType $@ &FFA
${CP} linked.${COMPONENT} ${LINKDIR}.${COMPONENT} ${CPFLAGS}
@echo ${COMPONENT}: rom_link complete
#
# Generate a Messages module
......
;
; This file is automatically maintained by srccommit, do not edit manually.
;
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "1.50"
Module_Version SETA 150
Module_MinorVersion SETS ""
Module_Date SETS "25 Oct 1999"
Module_FullVersion SETS "1.50"
GBLS Module_MajorVersion
GBLA Module_Version
GBLS Module_MinorVersion
GBLS Module_Date
GBLS Module_FullVersion
Module_MajorVersion SETS "1.51"
Module_Version SETA 151
Module_MinorVersion SETS ""
Module_Date SETS "12 Jan 2000"
Module_FullVersion SETS "1.51"
END
/* (1.50)
/* (1.51)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.50
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 25 Oct 1999
#define Module_MajorVersion_CMHG 1.51
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 12 Jan 2000
#define Module_MajorVersion "1.50"
#define Module_Version 150
#define Module_MinorVersion ""
#define Module_Date "25 Oct 1999"
#define Module_MajorVersion "1.51"
#define Module_Version 151
#define Module_MinorVersion ""
#define Module_Date "12 Jan 2000"
#define Module_FullVersion "1.50"
#define Module_FullVersion "1.51"
......@@ -14,6 +14,7 @@
;
SUBT => &.Arthur.Podule.Commands
CommandTable
= "Podules", 0
ALIGN
......@@ -53,7 +54,7 @@ null_string
; r0-r3 Much used for many things.
DoStarPodules ENTRY "r7-r8", 8 ; Stack frame for text conversions etc.
DoStarPodules Entry "r7-r8", 8 ; Stack frame for text conversions etc.
LDR wp, [ r12 ]
; Get Messages file open up front. This way we know we will not get
......
......@@ -46,6 +46,9 @@ GetHelpTexts SETS "GET HelpTexts"
GetHelpTexts SETS "GET s.HelpTokens"
]
AREA Podule_code, CODE, READONLY
GET s.Module
GET s.Interface
GET s.Commands
......
......@@ -36,6 +36,8 @@
; loader gives exception)
; 14-Oct-92 TMD Split off Victoria-specific version
; 25-Mar-95 JRH changed dline, dreg etc calls to DLINE, DREG since tutu is dead
; 11-Jan-00 PMS Converted to work with objasm so we can pass options in from MakeFile. Paul Skirrow.
; 12-Jan-00 PMS Added fake podule header for EtherI for Customer F Ethernet NC (see Module file). Paul Skirrow.
OPT OptPage
SVCEntry ROUT
......@@ -553,7 +555,7 @@ ReadBytes ROUT
; Trashes R10 and R11
;
WriteBytes ENTRY "r0-r3"
WriteBytes Entry "r0-r3"
BL ConvertR3ToPoduleNode
BLVC OnlyExtended
MOVVC r11, r1
......@@ -1521,7 +1523,7 @@ PoduleInstance SETA PoduleInstance + 1
; R11 = hardware base address
;
ReadDevice ENTRY "r0-r4, r7-r11"
ReadDevice Entry "r0-r4, r7-r11"
[ DebugInterface
DREG r1, "ReadDevice from &", cc
DREG r2, " for &"
......@@ -1683,7 +1685,7 @@ ReadDevice_EASIROM
; R11 = hardware base address
;
WriteDevice ENTRY "r0-r4, r7-r11"
WriteDevice Entry "r0-r4, r7-r11"
ADD r3, wp, r3 ; r3 -> node
LDR r9, [ r3, #PoduleNode_LoaderOffset ] ; offset from wp to loader, for ROM loader's benefit
[ NetworkPodule
......@@ -1955,7 +1957,7 @@ ExitSegmentHeader
; ENDIF
; ENDIF
;
GetSegmentHeader ENTRY "r7, r8"
GetSegmentHeader Entry "r7, r8"
ADD r8, wp, r3 ; Node record address
MOV r11, r1 ; R11 now is the base address
ADR r10, SegmentHeader
......
......@@ -12,11 +12,47 @@
; See the License for the specific language governing permissions and
; limitations under the License.
;
; => &.Arthur.Podule.Module
; => &.Arthur.Podule.Module
TTL The Podule manager for Arthur.
SUBT Module header => &.Arthur.Podule.Module
; ***********************************
; *** C h a n g e L i s t ***
; ***********************************
; Date Name Description
; ---- ---- -----------
; 12-Jan-00 PMS Added fake podule header for EtherI interface.
;
;
; Fake Podule Headers
; -------------------
; To keep production costs down the podule ROM is sometimes omitted from the final product,
; where an interface is built-in to the main motherboard (and hence always present).
; In such cases the podule manager can be made to provide a fake podule header, and this
; is used for STB MPEG hardware and also for the EtherI interface on a Customer F Ethernet NC.
;
; There are two ways to include the fake ROM header:
; 1. Set FakePodule0 in the machine header file
; 2. Set FakePodule in the components file (passed in via the MakeFile)
;
; If FakePodule is passed in from the MakeFile it overrides FakePodule0 in the machine file.
;
; The first approach is normally used, but the second approach is used for the Customer F 5 Ethernet NC
; where we use the same machine type as the Customer F 4 modem NC.
; (The Customer F 5 Ethernet NC is very closely based on the Customer F 4 modem NC.
; We don't want to introduce a new machine type as that would lead to other complications
; and make it more difficult to develop the Ethernet and Modem versions in tandem.)
GBLA FakePodule
[ :LNOT: :DEF: FakePodule
FakePodule SETA FakePodule0 ; Use FakePodule0 from the machine header file if not defined by Components/makefile
]
MySWIChunkBase * Module_SWISystemBase + PoduleSWI * Module_SWIChunkSize
ASSERT MySWIChunkBase = Podule_ReadID
......@@ -74,8 +110,8 @@ EASISpace SETL True
GBLL ExtensionROMs
ExtensionROMs SETL ExtROMSupport ; System build option
; We only know how to fake up STB2 MPEG1, MPEG2 (and MPEG0) podules
ASSERT (FakePodule0 = 0) :LOR: (FakePodule0 = ProdType_STB2_MPEG1) :LOR: (FakePodule0 = ProdType_STB2_MPEG2)
; We only know how to fake up STB2 MPEG1, MPEG2 (and MPEG0) podules and EtherI Podule
ASSERT (FakePodule = 0) :LOR: (FakePodule = ProdType_STB2_MPEG1) :LOR: (FakePodule = ProdType_STB2_MPEG2) :LOR: (FakePodule = ProdType_EtherI)
[ :LNOT: ReleaseVersion
! 0, "This version supports " :CC: ((:STR:NumberOfPodules) :RIGHT: 1) :CC: " podules"
......@@ -189,11 +225,15 @@ EndOfROM * &04000000
]
]
[ FakePodule0 <> 0
[ FakePodule = ProdType_STB2_MPEG1 :LOR: FakePodule = ProdType_STB2_MPEG2
MachineConfig * (IOMD_Base + IOMD_CLINES)
MPEGfittedbit * IOMD_C_MPEGfitted
MPEGIDByte * 0
]
[ FakePodule = ProdType_EtherI
EtherIIDByte * 0
]
maxint * &7FFFFFFF
......@@ -255,7 +295,7 @@ $label PoduleNode $link, $baseaddress, $romaddress, $cmos, $type, $easi, $
|
DCD NIL ; loader offset, initialised to no loader
]
ASSERT (:INDEX:. :AND: 3) = 0
ASSERT (.-Origin :AND: 3) = 0
DCD $baseaddress ; hardware base address
DCD maxint ; podule limit
DCD -1 ; enumeration limit
......@@ -266,7 +306,7 @@ $label PoduleNode $link, $baseaddress, $romaddress, $cmos, $type, $easi, $
DCW 0 ; Type (16 bits)
DCB 0 ; Flags, all zero
DCB 0 ; Spare
ASSERT (:INDEX:. :AND: 3) = 0
ASSERT (.-Origin :AND: 3) = 0
DCB 255 ; ID byte
LCLS inttype
[ ReassignedIOMDInterrupts :LAND: PoduleInstance = 0
......@@ -277,7 +317,7 @@ inttype SETS "$type"
DCB $inttype.IntValue
DCB $inttype.FIQasIntValue
DCB $inttype.FIQValue
ASSERT (:INDEX:. :AND: 3) = 0
ASSERT (.-Origin :AND: 3) = 0
DCD $cmos ; CMOS base address
DCD $romaddress + $cmos
DCD $dma
......@@ -369,7 +409,25 @@ $PoduleString
PoduleString SETS "ROMNodeChainHead * Podule" :CC: ((:STR: PoduleInstance) :RIGHT: 1) :CC: " + PoduleNode_Link"
$PoduleString
[ FakePodule0 <> 0
; Podule chunk directories in the header are 8 bytes (see PRM4-128):
MACRO
CHUNK $type,$contents,$description,$end
DCD $type ; Type: High nybble will be &F for NC
$len * ($end - $desc)/4 ; Length of field
$offset * ($desc - $contents)/4 ; Offset of field from start
DCD $len :AND: &FF ; Size in bytes
DCD ($len :SHR: 8) :AND &FF
DCD ($len :SHR: 16) :AND &FF
DCD $offset :AND: &FF ; Offset to chunk string
DCD ($offset :SHR: 8) :AND &FF
DCD ($offset :SHR: 16) :AND &FF
DCD ($offset :SHR: 24) :AND &FF
MEND
[ FakePodule = ProdType_STB2_MPEG1 :LOR: FakePodule = ProdType_STB2_MPEG2
MPEG0descoff * (MPEG0desc - MPEG0contents)/4 ; offset of description from start
MPEG0desclen * (MPEG0end - MPEG0desc)/4 ; length of description
MPEG0contents DCD &00, &02, &00, (ProdType_STB2_MPEG0 :AND: &FF), (ProdType_STB2_MPEG0 :SHR: 8)
......@@ -382,7 +440,7 @@ MPEG0desc DCD 'I', 'n', 't', 'e', 'r', 'n', 'a', 'l'
DCD 'a', 'r', 'd', 'w', 'a', 'r', 'e', 0
MPEG0end
ALIGN
[ FakePodule0 = ProdType_STB2_MPEG1
[ FakePodule = ProdType_STB2_MPEG1
MPEG1descoff * (MPEG1desc - MPEG1contents)/4 ; offset of description from start
MPEG1desclen * (MPEG1end - MPEG1desc)/4 ; length of description
......@@ -413,6 +471,56 @@ MPEG1end
]
]
; Fake Podule header for Customer F 5 Ethernet NC.
; This Ethernet NC has on-board Ethernet and although it has a podule ROM socket
; this ROM is not fitted to reduce cost. We therefore provide a fake podule header here.
; See PRM 4-122. Paul Skirrow 12 Jan 2000.
;
; Podule chunk directories in the header are 8 bytes (see PRM4-128):
MACRO
PODCHUNK $type,$contents,$desc,$end
LCLA len
LCLA offset
DCD $type ; Type: High nybble will be &F for NC
; len SETA ($end - $desc)/4 ; Length of field
; offset SETA ($desc - $contents)/4 ; Offset of field from start
DCD (($end - $desc)/4) :AND: &FF ; Size in bytes
DCD ((($end - $desc)/4) :SHR: 8) :AND: &FF
DCD ((($end - $desc)/4) :SHR: 16) :AND: &FF
DCD (($desc - $contents)/4) :AND: &FF ; Offset to chunk string
DCD ((($desc - $contents)/4) :SHR: 8) :AND: &FF
DCD ((($desc - $contents)/4) :SHR: 16) :AND: &FF
DCD ((($desc - $contents)/4) :SHR: 24) :AND: &FF
MEND
[ FakePodule = ProdType_EtherI
EtherIcontents DCD &00 ; Interrupts, IRQ and FIQ are relocated
DCD &03 ; Interrupt Status Pointers and Chunk dir follow ECId
DCD &00 ; Reserved
DCD (ProdType_EtherI :AND: &FF) ; Product type low byte
DCD (ProdType_EtherI :SHR: 8) ; Product type hight byte
DCD (Manf_AcornUK :AND: &FF) ; Manufacturer code, low byte
DCD (Manf_AcornUK :SHR: 8) ; Manufacturer code, high byte
DCD 0 ; Country code (0=UK)
DCD 0, 0, 0, 0, 0, 0, 0, 0 ; Interrupt status pointers
; Chunks follow:
PODCHUNK &f5, EtherIcontents, EtherIdesc, EtherIdescend ; Description: "10baseT Ethernet..."
PODCHUNK &f3, EtherIcontents, EtherImod, EtherImodend ; Modifications status byte: 4
DCD 0, 0, 0, 0, 0, 0, 0, 0 ; End of chunk directory
EtherIdesc DCD '1', '0', 'B', 'a', 's', 'e', 'T', ' '
DCD 'E', 't', 'h', 'e', 'r', 'n', 'e', 't'
DCD ' ', '6', '4', 'k', ' ', 'b', 'u', 'f'
DCD 'f', 'e', 'r', ' ', '(', 'A', ' ', 'c'
DCD 'y', 'c', 'l', 'e', 's', ')', 0
EtherIdescend
EtherImod DCD '4', 0 ; Modification byte
EtherImodend
]
; *****************************************************************************************************************
;
; ExtensionROMLoader - Loader for reading extension ROM
......@@ -657,14 +765,24 @@ InitialisationLoop
[ ExtensionROMs
BL FindExtensionROMs
]
; Fake Podule ROM Headers
;
; Some systems (such as STB and Customer F 5 Ethernet NC) have hardware fitted to the main board which
; would traditionally have been implemented on an expansion card. Although there is normally
; space for an expansion card ROM, it is not normally fitted and we fake the ROM header.
; The hardware appears as expansion card 0 (podule 0) and the other expansion cards work normally
; (if available).
;
; If this is a Set-Top Box, then we know we've got MPEG hardware fitted as Podule0 but without the (EP)ROM
; We'll make if look like its a real podule
[ FakePodule0 <> 0
[ FakePodule = ProdType_STB2_MPEG1 :LOR: FakePodule = ProdType_STB2_MPEG2
ADRL r0, NormalPoduleNodeOffsets ; work out address of podule0 node
LDR r0, [r0]
ADD r0, r0, r2 ; make it an absolute address
MOV r1, #MPEGIDByte
MOV r1, #MPEGIDByte ; ID byte for fake MPEG podule
STRB r1, [ r0, #PoduleNode_IDByte ] ; set ID byte to make ConvertR3ToPoduleNode happy
MOV r1, #BitZero
......@@ -685,6 +803,32 @@ InitialisationLoop
ADRNE r1, MPEG1contents
STR r1, [ r0, #PoduleNode_ROMAddress ] ; Location to read header from
]
; Fake EtherI podule ROM:
[ FakePodule = ProdType_EtherI
ADRL r0, NormalPoduleNodeOffsets ; work out address of podule0 node
LDR r0, [r0]
ADD r0, r0, r2 ; make it an absolute address
MOV r1, #EtherIIDByte ; ID byte for fake EtherI podule
STRB r1, [ r0, #PoduleNode_IDByte ] ; set ID byte to make ConvertR3ToPoduleNode happy
MOV r1, #BitZero
STRB r1, [ r0, #PoduleNode_Flags ] ; This is a (fake) Podule
MOV r1, #PoduleCMOS
STR r1, [ r0, #PoduleNode_CMOS ] ; We don't have no CMOS
MOV r1, #-1
STR r1, [ r0, #PoduleNode_DMA ] ; We don't do DMA
; We are faking an EtherI podule ROM, so point the podule ROM address to the appropriate fake header
; The description string will be extracted from this block in the normal way when chunks get enumerated
ADR r1, EtherIcontents
STR r1, [ r0, #PoduleNode_ROMAddress ] ; Location to read header from
]
BL LoadAllLoaders ; ensure all loaders are loaded
ReInitialisation ; Address of workspace in R2, Address of Private word in R12
......
......@@ -29,7 +29,7 @@ temp_block_size * 512
; Out: r3-r11 preserved, r0-r2 undefined, flags undefined
; Error: r0 -> error block, V set
gs_lookup_print_string_two ENTRY "r3-r7"
gs_lookup_print_string_two Entry "r3-r7"
BL open_message_file
EXIT VS
[ DebugCommands
......@@ -137,7 +137,7 @@ free_block ; r2 still points to the block!
; Out: r0 -> Translated error block or another error (token no found etc.)
; All other registers preserved, V always set, other flags undefined
copy_error_one ENTRY "r2-r7"
copy_error_one Entry "r2-r7"
[ DebugModule
DLINE "Copy_Error_One called"
]
......@@ -157,7 +157,7 @@ copy_error_one ENTRY "r2-r7"
; Same as copy_error_one() but with no parameter.
copy_error_zero ENTRY "r1"
copy_error_zero Entry "r1"
MOV r1, #0 ; No %0
BL copy_error_one
EXIT
......
......@@ -67,7 +67,7 @@ ROMExtension_Size |#| 4
; R2 -> workspace (not necessarily where it used to be)
; All others must be preserved
FindExtensionROMs ENTRY "R6-R11"
FindExtensionROMs Entry "R6-R11"
STR R2, [R12] ; point private word at workspace
ADR P0, EndOfROM
MOV P1, P0
......@@ -775,7 +775,7 @@ DecrementP3
; VC => all preserved
;
AddROMNode ENTRY "R0-R4, R9-R11"
AddROMNode Entry "R0-R4, R9-R11"
; first check that ROM is not a ghost duplicate
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment