Makefile fix, add some HW info in HDMIAudio RSRC for the driver

This commit is contained in:
Romain Dolbeau 2023-10-12 22:55:28 +02:00
parent 9f0ada85e1
commit b7d43ee30a
3 changed files with 30 additions and 4 deletions

View File

@ -23,6 +23,7 @@ ifeq (${TARGET},QUADRAFPGA)
endif
CFLAGS+=${FEATURES}
HOSTCFLAGS+=${FEATURES}
NS816DECLROMDIR=./ns816-declrom
NUBUS_CHECKSUM=${NS816DECLROMDIR}/nubus_checksum
@ -56,7 +57,7 @@ ${GEN_ASM}: gen_mode
$(NUBUS_CHECKSUM): ${NS816DECLROMDIR}/nubus_checksum.cc ${NS816DECLROMDIR}/nubus_crc.cc
g++ -std=c++11 $^ -lglog -lgflags -labsl_strings -o $@
vid_decl_rom.o: vid_decl_rom.s NuBusFPGADrvr.s NuBusFPGARAMDskDrvr.s ${APPLEINCS} DepVideo.inc ${GEN_ASM}
vid_decl_rom.o: vid_decl_rom.s NuBusFPGADrvr.s NuBusFPGARAMDskDrvr.s ${APPLEINCS} DepVideo.inc ${GEN_ASM} goblin_param.inc
rm -f res.inc
echo -e "HRES=${HRES}\nVRES=${VRES}\n" | tee res.inc
${AS} ${ARCHFLAGS} -I${NS816DECLROMDIR} $< -o $@ -a > vid_decl_rom.l
@ -82,8 +83,11 @@ vid_decl_rom.bin: vid_decl_rom.raw $(NUBUS_CHECKSUM)
${NUBUS_CHECKSUM} --input_file $< --output_file $@ --output_size 32768
dd if=dump.cpr of=vid_decl_rom.bin bs=1 conv=notrunc
goblin_param.inc: ../../csr.csv
./gen_goblin_audio_param.sh
clean:
rm -f res.inc ${CSRC_ASM} *.o vid_decl_rom.srec vid_decl_rom.raw vid_decl_rom.dir vid_decl_rom.l VidRom*.s
rm -f res.inc ${CSRC_ASM} *.o vid_decl_rom.srec vid_decl_rom.raw vid_decl_rom.dir vid_decl_rom.l VidRom*.s gen_mode goblin_param.inc
append_romdir: append_romdir.c
${HOSTCC} $< -o $@

View File

@ -0,0 +1,13 @@
#!/bin/bash
/bin/rm -f goblin_param.inc
touch goblin_param.inc
echo -n 'csr_goblin_base = ' >> goblin_param.inc
grep -q csr_base,goblin ../../csr.csv || echo "0x0" >> goblin_param.inc
grep csr_base,goblin ../../csr.csv | awk -F, '{ print $3}' | sed -e 's/0x[fF]0a0/0x00a0/' >> goblin_param.inc
echo 'goblin_audiobuffer_offset = 0x00920000' >> goblin_param.inc
echo 'goblin_audiobuffer_size = 0x00002000' >> goblin_param.inc

View File

@ -198,9 +198,12 @@ _SDCardDrvrDir:
/* ////////////////////////////////////////////// HDMI AUDIO */
.section .text.begin
.include "goblin_param.inc"
ALIGN 2
_sRsrc_HDMIAudio:
OSLstEntry sRsrcType,_HDMIAudioType /* video type descriptor */
OSLstEntry 0xd0,_HDMIAudioInfo
/* no driver */
.long EndOfList /* end of list */
ALIGN 2
@ -208,9 +211,15 @@ _HDMIAudioType:
.short catProto /* <Category> */
.short typeAudio /* custom */ /* <Type> */
.short drSwApple /* <DrvrSw> */
.short DrHwNuBusFPGAAudio /* <DrvrHw> */
.short DrHwNuBusFPGAAudio /* <DrvrHw> */
ALIGN 2
_HDMIAudioInfo:
.long csr_goblin_base /* where to find the CSR */
.long goblin_audiobuffer_offset
.long goblin_audiobuffer_size
/* ////////////////////////////////////////////// DECLARION ROM */
/* Declaration ROM directory at end */
.section .romblock
ALIGN 2