From: Michael Buesch Date: Thu, 19 Jun 2008 21:48:44 +0000 (+0200) Subject: b43-asm: Add tram keyword for writing to template ram X-Git-Tag: b43-fwcutter-013~30 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=949f7affad6c3948d20c6d3dabb866143000e89d;p=b43-tools.git b43-asm: Add tram keyword for writing to template ram Signed-off-by: Michael Buesch --- diff --git a/assembler/initvals.c b/assembler/initvals.c index b403563..5db74d1 100644 --- a/assembler/initvals.c +++ b/assembler/initvals.c @@ -189,6 +189,15 @@ static void assemble_write_shm(struct ivals_context *ctx, } } +/* Template RAM write */ +static void assemble_write_tram(struct ivals_context *ctx, + unsigned int offset, + unsigned int value) +{ + assemble_write_mmio(ctx, 0x130, SIZE_32BIT, offset); + assemble_write_mmio(ctx, 0x134, SIZE_32BIT, value); +} + static void assemble_ival_section(struct ivals_context *ctx, const struct initvals_sect *sect) { @@ -231,6 +240,10 @@ static void assemble_ival_section(struct ivals_context *ctx, op->args[0], SIZE_32BIT); break; + case IVAL_W_TRAM: + assemble_write_tram(ctx, op->args[1], + op->args[0]); + break; } } } diff --git a/assembler/initvals.h b/assembler/initvals.h index 0afecf2..0530a8f 100644 --- a/assembler/initvals.h +++ b/assembler/initvals.h @@ -12,6 +12,7 @@ struct initval_op { IVAL_W_RADIO, IVAL_W_SHM16, IVAL_W_SHM32, + IVAL_W_TRAM, } type; unsigned int args[3]; diff --git a/assembler/parser.y b/assembler/parser.y index 50065ba..4ace330 100644 --- a/assembler/parser.y +++ b/assembler/parser.y @@ -45,7 +45,7 @@ extern struct initvals_sect *cur_initvals_sect; %token OP_ADD OP_ADDSC OP_ADDC OP_ADDSCC OP_SUB OP_SUBSC OP_SUBC OP_SUBSCC OP_SRA OP_OR OP_AND OP_XOR OP_SR OP_SRX OP_SL OP_RL OP_RR OP_NAND OP_ORX OP_MOV OP_JMP OP_JAND OP_JNAND OP_JS OP_JNS OP_JE OP_JNE OP_JLS OP_JGES OP_JGS OP_JLES OP_JL OP_JGE OP_JG OP_JLE OP_JZX OP_JNZX OP_JEXT OP_JNEXT OP_CALL OP_RET OP_TKIPH OP_TKIPHS OP_TKIPL OP_TKIPLS OP_NAP RAW_CODE -%token IVAL_MMIO16 IVAL_MMIO32 IVAL_PHY IVAL_RADIO IVAL_SHM16 IVAL_SHM32 +%token IVAL_MMIO16 IVAL_MMIO32 IVAL_PHY IVAL_RADIO IVAL_SHM16 IVAL_SHM32 IVAL_TRAM %start line @@ -149,6 +149,13 @@ ivals_write : IVAL_MMIO16 imm_value COMMA imm_value { iop->args[2] = (unsigned int)(unsigned long)$6; $$ = iop; } + | IVAL_TRAM imm_value COMMA imm_value { + struct initval_op *iop = xmalloc(sizeof(struct initval_op)); + iop->type = IVAL_W_TRAM; + iop->args[0] = (unsigned int)(unsigned long)$2; + iop->args[1] = (unsigned int)(unsigned long)$4; + $$ = iop; + } ; statement : asmdir { diff --git a/assembler/scanner.l b/assembler/scanner.l index 5013d0e..b135552 100644 --- a/assembler/scanner.l +++ b/assembler/scanner.l @@ -142,6 +142,7 @@ phy { update_lineinfo(); return IVAL_PHY; } radio { update_lineinfo(); return IVAL_RADIO; } shm16 { update_lineinfo(); return IVAL_SHM16; } shm32 { update_lineinfo(); return IVAL_SHM32; } +tram { update_lineinfo(); return IVAL_TRAM; } @[0-9a-fA-F]{3,3} { update_lineinfo(); return RAW_CODE; } diff --git a/assembler/test.asm b/assembler/test.asm index 2c25dde..a228d45 100644 --- a/assembler/test.asm +++ b/assembler/test.asm @@ -193,6 +193,7 @@ function_b: radio 0x1234, 0xABC /* Write 0x1234 to RADIO register 0xABC */ shm16 0x1234, 0x0001, 0x0002 /* Write 0x1234 to SHM routing 0x0001, register 0x0002 */ shm32 0x12345678, 0x0001, 0x0002 /* Write 0x12345678 to SHM routing 0x0001, register 0x0002 */ + tram 0x12345678, 0x1234 /* Write 0x12345678 to Template Ram offset 0x1234 */ // vim: syntax=b43 ts=8