X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=assembler%2Finitvals.c;h=5c968dff4666d4f44fbb1aeb875ebed98a274817;hb=b756ecc447336244a0340daaa821a12c2b8f7c61;hp=eb2634d20a213bd18efcb2f477b9712a6f95e137;hpb=b9e19faa25ad9e1b24f08dc77267760df1b98504;p=b43-tools.git diff --git a/assembler/initvals.c b/assembler/initvals.c index eb2634d..5c968df 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; } } } @@ -276,15 +289,16 @@ static void emit_ival_section(struct ivals_context *ctx) struct initval_raw raw; struct fw_header hdr; unsigned int size; + unsigned int filesize = 0; memset(&hdr, 0, sizeof(hdr)); hdr.type = FW_TYPE_IV; hdr.ver = FW_HDR_VER; hdr.size = cpu_to_be32(ctx->ivals_count); - fn_len = strlen(outfile_name) + 512; + fn_len = strlen(ctx->sect->name) + strlen(cmdargs.initvals_fn_extension ? : "") + 1; fn = xmalloc(fn_len); - snprintf(fn, fn_len, "%s.%s.initval", outfile_name, ctx->sect->name); + snprintf(fn, fn_len, "%s%s", ctx->sect->name, cmdargs.initvals_fn_extension ? : ""); fd = fopen(fn, "w+"); if (!fd) { fprintf(stderr, "Could not open initval output file \"%s\"\n", fn); @@ -311,7 +325,14 @@ static void emit_ival_section(struct ivals_context *ctx) fprintf(stderr, "Could not write initvals outfile\n"); exit(1); } + filesize += size; } + + if (cmdargs.print_sizes) { + printf("%s: %d values (%u bytes)\n", + fn, ctx->ivals_count, filesize); + } + fclose(fd); free(fn); }