size_t console_size;
        size_t ftrace_size;
        int dump_oops;
-       int ecc_size;
+       struct persistent_ram_ecc_info ecc_info;
        unsigned int max_dump_cnt;
        unsigned int dump_write_cnt;
        unsigned int dump_read_cnt;
        for (i = 0; i < cxt->max_dump_cnt; i++) {
                size_t sz = cxt->record_size;
 
-               cxt->przs[i] = persistent_ram_new(*paddr, sz, 0, cxt->ecc_size);
+               cxt->przs[i] = persistent_ram_new(*paddr, sz, 0,
+                                                 &cxt->ecc_info);
                if (IS_ERR(cxt->przs[i])) {
                        err = PTR_ERR(cxt->przs[i]);
                        dev_err(dev, "failed to request mem region (0x%zx@0x%llx): %d\n",
                return -ENOMEM;
        }
 
-       *prz = persistent_ram_new(*paddr, sz, sig, cxt->ecc_size);
+       *prz = persistent_ram_new(*paddr, sz, sig, &cxt->ecc_info);
        if (IS_ERR(*prz)) {
                int err = PTR_ERR(*prz);
 
        cxt->console_size = pdata->console_size;
        cxt->ftrace_size = pdata->ftrace_size;
        cxt->dump_oops = pdata->dump_oops;
-       cxt->ecc_size = pdata->ecc_size;
+       cxt->ecc_info = pdata->ecc_info;
 
        paddr = cxt->phys_addr;
 
        record_size = pdata->record_size;
        dump_oops = pdata->dump_oops;
 
-       pr_info("attached 0x%lx@0x%llx, ecc: %d\n",
+       pr_info("attached 0x%lx@0x%llx, ecc: %d/%d\n",
                cxt->size, (unsigned long long)cxt->phys_addr,
-               cxt->ecc_size);
+               cxt->ecc_info.ecc_size, cxt->ecc_info.block_size);
 
        return 0;
 
         * For backwards compatibility ramoops.ecc=1 means 16 bytes ECC
         * (using 1 byte for ECC isn't much of use anyway).
         */
-       dummy_data->ecc_size = ramoops_ecc == 1 ? 16 : ramoops_ecc;
+       dummy_data->ecc_info.ecc_size = ramoops_ecc == 1 ? 16 : ramoops_ecc;
 
        dummy = platform_device_register_data(NULL, "ramoops", -1,
                        dummy_data, sizeof(struct ramoops_platform_data));
 
        uint8_t *data, size_t len, uint8_t *ecc)
 {
        int i;
-       uint16_t par[prz->ecc_size];
+       uint16_t par[prz->ecc_info.ecc_size];
 
        /* Initialize the parity buffer */
        memset(par, 0, sizeof(par));
        encode_rs8(prz->rs_decoder, data, len, par, 0);
-       for (i = 0; i < prz->ecc_size; i++)
+       for (i = 0; i < prz->ecc_info.ecc_size; i++)
                ecc[i] = par[i];
 }
 
        void *data, size_t len, uint8_t *ecc)
 {
        int i;
-       uint16_t par[prz->ecc_size];
+       uint16_t par[prz->ecc_info.ecc_size];
 
-       for (i = 0; i < prz->ecc_size; i++)
+       for (i = 0; i < prz->ecc_info.ecc_size; i++)
                par[i] = ecc[i];
        return decode_rs8(prz->rs_decoder, data, par, len,
                                NULL, 0, NULL, 0, NULL);
        uint8_t *buffer_end = buffer->data + prz->buffer_size;
        uint8_t *block;
        uint8_t *par;
-       int ecc_block_size = prz->ecc_block_size;
-       int ecc_size = prz->ecc_size;
-       int size = prz->ecc_block_size;
+       int ecc_block_size = prz->ecc_info.block_size;
+       int ecc_size = prz->ecc_info.ecc_size;
+       int size = ecc_block_size;
 
-       if (!prz->ecc_size)
+       if (!ecc_size)
                return;
 
        block = buffer->data + (start & ~(ecc_block_size - 1));
-       par = prz->par_buffer + (start / ecc_block_size) * prz->ecc_size;
+       par = prz->par_buffer + (start / ecc_block_size) * ecc_size;
 
        do {
                if (block + ecc_block_size > buffer_end)
 {
        struct persistent_ram_buffer *buffer = prz->buffer;
 
-       if (!prz->ecc_size)
+       if (!prz->ecc_info.ecc_size)
                return;
 
        persistent_ram_encode_rs8(prz, (uint8_t *)buffer, sizeof(*buffer),
        uint8_t *block;
        uint8_t *par;
 
-       if (!prz->ecc_size)
+       if (!prz->ecc_info.ecc_size)
                return;
 
        block = buffer->data;
        par = prz->par_buffer;
        while (block < buffer->data + buffer_size(prz)) {
                int numerr;
-               int size = prz->ecc_block_size;
+               int size = prz->ecc_info.block_size;
                if (block + size > buffer->data + prz->buffer_size)
                        size = buffer->data + prz->buffer_size - block;
                numerr = persistent_ram_decode_rs8(prz, block, size, par);
                                block);
                        prz->bad_blocks++;
                }
-               block += prz->ecc_block_size;
-               par += prz->ecc_size;
+               block += prz->ecc_info.block_size;
+               par += prz->ecc_info.ecc_size;
        }
 }
 
 static int persistent_ram_init_ecc(struct persistent_ram_zone *prz,
-                                  int ecc_size)
+                                  struct persistent_ram_ecc_info *ecc_info)
 {
        int numerr;
        struct persistent_ram_buffer *buffer = prz->buffer;
        int ecc_blocks;
        size_t ecc_total;
-       int ecc_symsize = 8;
-       int ecc_poly = 0x11d;
 
-       if (!ecc_size)
+       if (!ecc_info || !ecc_info->ecc_size)
                return 0;
 
-       prz->ecc_block_size = 128;
-       prz->ecc_size = ecc_size;
+       prz->ecc_info.block_size = ecc_info->block_size ?: 128;
+       prz->ecc_info.ecc_size = ecc_info->ecc_size ?: 16;
+       prz->ecc_info.symsize = ecc_info->symsize ?: 8;
+       prz->ecc_info.poly = ecc_info->poly ?: 0x11d;
 
-       ecc_blocks = DIV_ROUND_UP(prz->buffer_size - prz->ecc_size,
-                                 prz->ecc_block_size + prz->ecc_size);
-       ecc_total = (ecc_blocks + 1) * prz->ecc_size;
+       ecc_blocks = DIV_ROUND_UP(prz->buffer_size - prz->ecc_info.ecc_size,
+                                 prz->ecc_info.block_size +
+                                 prz->ecc_info.ecc_size);
+       ecc_total = (ecc_blocks + 1) * prz->ecc_info.ecc_size;
        if (ecc_total >= prz->buffer_size) {
                pr_err("%s: invalid ecc_size %u (total %zu, buffer size %zu)\n",
-                      __func__, prz->ecc_size, ecc_total, prz->buffer_size);
+                      __func__, prz->ecc_info.ecc_size,
+                      ecc_total, prz->buffer_size);
                return -EINVAL;
        }
 
        prz->buffer_size -= ecc_total;
        prz->par_buffer = buffer->data + prz->buffer_size;
-       prz->par_header = prz->par_buffer + ecc_blocks * prz->ecc_size;
+       prz->par_header = prz->par_buffer +
+                         ecc_blocks * prz->ecc_info.ecc_size;
 
        /*
         * first consecutive root is 0
         * primitive element to generate roots = 1
         */
-       prz->rs_decoder = init_rs(ecc_symsize, ecc_poly, 0, 1, prz->ecc_size);
+       prz->rs_decoder = init_rs(prz->ecc_info.symsize, prz->ecc_info.poly,
+                                 0, 1, prz->ecc_info.ecc_size);
        if (prz->rs_decoder == NULL) {
                pr_info("persistent_ram: init_rs failed\n");
                return -EINVAL;
 }
 
 static int persistent_ram_post_init(struct persistent_ram_zone *prz, u32 sig,
-                                   int ecc_size)
+                                   struct persistent_ram_ecc_info *ecc_info)
 {
        int ret;
 
-       ret = persistent_ram_init_ecc(prz, ecc_size);
+       ret = persistent_ram_init_ecc(prz, ecc_info);
        if (ret)
                return ret;
 
 }
 
 struct persistent_ram_zone *persistent_ram_new(phys_addr_t start, size_t size,
-                                              u32 sig, int ecc_size)
+                       u32 sig, struct persistent_ram_ecc_info *ecc_info)
 {
        struct persistent_ram_zone *prz;
        int ret = -ENOMEM;
        if (ret)
                goto err;
 
-       ret = persistent_ram_post_init(prz, sig, ecc_size);
+       ret = persistent_ram_post_init(prz, sig, ecc_info);
        if (ret)
                goto err;