- /*
- * The SH3 variant (SH770x, SH7705, SH7710 and SH7720) maps channel
- * registers blocks at base + 2 + 12 * index, while all other variants
- * map them at base + 4 + 12 * index. We can compute the index by just
- * dividing by 12, the 2 bytes or 4 bytes offset being hidden by the
- * integer division.
- */
- ch->index = cfg->channel_offset / 12;
+ if (tmu->model == SH_TMU_LEGACY) {
+ struct sh_timer_config *cfg = tmu->pdev->dev.platform_data;
+
+ /*
+ * The SH3 variant (SH770x, SH7705, SH7710 and SH7720) maps
+ * channel registers blocks at base + 2 + 12 * index, while all
+ * other variants map them at base + 4 + 12 * index. We can
+ * compute the index by just dividing by 12, the 2 bytes or 4
+ * bytes offset being hidden by the integer division.
+ */
+ ch->index = cfg->channel_offset / 12;
+ ch->base = tmu->mapbase + cfg->channel_offset;
+ } else {
+ ch->index = index;
+
+ if (tmu->model == SH_TMU_SH3)
+ ch->base = tmu->mapbase + 4 + ch->index * 12;
+ else
+ ch->base = tmu->mapbase + 8 + ch->index * 12;
+ }