diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-10-20 07:42:24 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-11-11 11:55:55 -0500 |
commit | 17bdf48952d3f5c0be8137058f81d398d4606820 (patch) | |
tree | 8d18540fd6343dec288a58e5e1044fe2823b8912 /drivers/video/cirrusfb.c | |
parent | 0e0d13364b417a40266999c61671db0ef8690ad3 (diff) |
fbdev/cirrusfb: Add support for Picasso IV in Zorro II mode
In Zorro II mode, the Village Tronic Picasso IV graphics card shows up as
either 2 or 3 Zorro devices:
- One for the registers of the Cirrus Logic graphics chip,
- One for the first bank of 2 MiB of graphics memory,
- An optional one for the second bank of 2 MiB of graphics memory,
if there was enough free Zorro II address space.
Based on src/sys/arch/amiga/dev/grf_cl.c from NetBSD.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/cirrusfb.c')
-rw-r--r-- | drivers/video/cirrusfb.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/video/cirrusfb.c b/drivers/video/cirrusfb.c index 357139ab7a0f..816433ffec9d 100644 --- a/drivers/video/cirrusfb.c +++ b/drivers/video/cirrusfb.c | |||
@@ -287,6 +287,7 @@ struct zorrocl { | |||
287 | /* If zero, use autoprobe on RAM device */ | 287 | /* If zero, use autoprobe on RAM device */ |
288 | u32 ramoffset; /* Offset of video RAM in first Zorro device */ | 288 | u32 ramoffset; /* Offset of video RAM in first Zorro device */ |
289 | zorro_id ramid; /* Zorro ID of RAM device */ | 289 | zorro_id ramid; /* Zorro ID of RAM device */ |
290 | zorro_id ramid2; /* Zorro ID of optional second RAM device */ | ||
290 | }; | 291 | }; |
291 | 292 | ||
292 | static const struct zorrocl zcl_sd64 __devinitconst = { | 293 | static const struct zorrocl zcl_sd64 __devinitconst = { |
@@ -316,6 +317,13 @@ static const struct zorrocl zcl_picasso4_z3 __devinitconst = { | |||
316 | .ramoffset = 0x01000000, | 317 | .ramoffset = 0x01000000, |
317 | }; | 318 | }; |
318 | 319 | ||
320 | static const struct zorrocl zcl_picasso4_z2 __devinitconst = { | ||
321 | .type = BT_PICASSO4, | ||
322 | .regoffset = 0x10000, | ||
323 | .ramid = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM1, | ||
324 | .ramid2 = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_RAM2, | ||
325 | }; | ||
326 | |||
319 | 327 | ||
320 | static const struct zorro_device_id cirrusfb_zorro_table[] __devinitconst = { | 328 | static const struct zorro_device_id cirrusfb_zorro_table[] __devinitconst = { |
321 | { | 329 | { |
@@ -333,6 +341,9 @@ static const struct zorro_device_id cirrusfb_zorro_table[] __devinitconst = { | |||
333 | }, { | 341 | }, { |
334 | .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3, | 342 | .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z3, |
335 | .driver_data = (unsigned long)&zcl_picasso4_z3, | 343 | .driver_data = (unsigned long)&zcl_picasso4_z3, |
344 | }, { | ||
345 | .id = ZORRO_PROD_VILLAGE_TRONIC_PICASSO_IV_Z2_REG, | ||
346 | .driver_data = (unsigned long)&zcl_picasso4_z2, | ||
336 | }, | 347 | }, |
337 | { 0 } | 348 | { 0 } |
338 | }; | 349 | }; |
@@ -2257,6 +2268,16 @@ static int __devinit cirrusfb_zorro_register(struct zorro_dev *z, | |||
2257 | } | 2268 | } |
2258 | rambase = zorro_resource_start(ram); | 2269 | rambase = zorro_resource_start(ram); |
2259 | ramsize = zorro_resource_len(ram); | 2270 | ramsize = zorro_resource_len(ram); |
2271 | if (zcl->ramid2 && | ||
2272 | (ram = zorro_find_device(zcl->ramid2, NULL))) { | ||
2273 | if (zorro_resource_start(ram) != rambase + ramsize) { | ||
2274 | dev_warn(info->device, | ||
2275 | "Skipping non-contiguous RAM at %pR\n", | ||
2276 | &ram->resource); | ||
2277 | } else { | ||
2278 | ramsize += zorro_resource_len(ram); | ||
2279 | } | ||
2280 | } | ||
2260 | } | 2281 | } |
2261 | 2282 | ||
2262 | dev_info(info->device, | 2283 | dev_info(info->device, |