Commit 949f7aff authored by Michael Büsch's avatar Michael Büsch

b43-asm: Add tram keyword for writing to template ram

Signed-off-by: Michael Büsch's avatarMichael Buesch <mb@bu3sch.de>
parent 89a6bd4b
......@@ -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;
}
}
}
......
......@@ -12,6 +12,7 @@ struct initval_op {
IVAL_W_RADIO,
IVAL_W_SHM16,
IVAL_W_SHM32,
IVAL_W_TRAM,
} type;
unsigned int args[3];
......
......@@ -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 {
......
......@@ -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; }
......
......@@ -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
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