Changeset 9cf07b3 in mainline
- Timestamp:
- 2012-08-31T12:11:53Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 469e0cf
- Parents:
- ff166148
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/include/drivers/amdm37x_dispc/amdm37x_dispc.h
rff166148 r9cf07b3 41 41 #define AMDM37x_DISPC_SIZE 1024 42 42 43 #define __paddname(line) PADD32_ ## line 44 #define _paddname(line) __paddname(line) 45 #define PADD32(count) uint32_t _paddname(__LINE__)[count] 46 43 47 #include <typedefs.h> 44 48 … … 47 51 #define AMDMD37X_DISPC_REVISION_MASK 0xff 48 52 49 uint32_t padd0_[3];53 PADD32(3); 50 54 ioport32_t sysconfig; 51 55 #define AMDMD37X_DISPC_SYSCONFIG_AUTOIDLE_FLAG (1 << 0) … … 82 86 #define AMDMD37X_DISPC_IRQ_WAKEUP_FLAG (1 << 16) 83 87 84 uint32_t padd1_[8];88 PADD32(8); 85 89 ioport32_t control; 86 90 #define AMDMD37X_DISPC_CONTROL_LCD_ENABLE_FLAG (1 << 0) … … 145 149 #define AMDMD37X_DISPC_CONFIG_TVALPHABLENDERENABLE_FLAG (1 << 19) 146 150 147 uint32_t padd2_;151 PADD32(1); 148 152 ioport32_t default_color[2]; 149 153 ioport32_t trans_color[2]; … … 197 201 ioport32_t size_lcd; 198 202 199 ioport32_t gfx_ba[2]; 200 ioport32_t gfx_position; 203 struct { 204 ioport32_t ba[2]; 205 ioport32_t position; 201 206 #define AMDMD37X_DISPC_GFX_POSITION_GFXPOSX_MASK 0x7ff 202 207 #define AMDMD37X_DISPC_GFX_POSITION_GFXPOSX_SHIFT 0 … … 204 209 #define AMDMD37X_DISPC_GFX_POSITION_GFXPOSY_SHIFT 16 205 210 206 ioport32_t gfx_size;211 ioport32_t size; 207 212 #define AMDMD37X_DISPC_SIZE_WIDTH_MASK 0x7ff 208 213 #define AMDMD37X_DISPC_SIZE_WIDTH_SHIFT 0 … … 210 215 #define AMDMD37X_DISPC_SIZE_HEIGHT_SHIFT 16 211 216 212 uint32_t padd3_[4];213 ioport32_t gfx_attributes;217 PADD32(4); 218 ioport32_t attributes; 214 219 #define AMDMD37X_DISPC_GFX_ATTRIBUTES_ENABLE_FLAG (1 << 0) 215 220 #define AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_MASK 0xf … … 236 241 237 242 238 ioport32_t gfx_fifo_threshold; 239 const ioport32_t fifo_size_status; 240 ioport32_t gfx_row_inc; 241 ioport32_t gfx_pixel_inc; 242 ioport32_t gfx_window_skip; 243 ioport32_t gfx_table_ba; 244 // TODO complete me... 245 243 ioport32_t fifo_threshold; 244 const ioport32_t fifo_size_status; 245 ioport32_t row_inc; 246 ioport32_t pixel_inc; 247 ioport32_t window_skip; 248 ioport32_t table_ba; 249 } gfx; 250 251 struct { 252 ioport32_t ba[2]; 253 ioport32_t position; 254 ioport32_t size; 255 ioport32_t attributes; 256 ioport32_t fifo_threshold; 257 const ioport32_t fifo_size_status; 258 ioport32_t row_inc; 259 ioport32_t pixel_inc; 260 ioport32_t fir; 261 ioport32_t picture_size; 262 ioport32_t accui[2]; 263 struct { 264 ioport32_t hi; 265 ioport32_t hvi; 266 } fir_coef[8]; 267 ioport32_t conv_coef[5]; 268 PADD32(2); 269 } vid[2]; 270 /* 0x1d4 */ 271 ioport32_t data_cycle[3]; 272 /* 0x1e0 */ 273 ioport32_t vid_fir_coef_v[8]; 274 /* 0x200 */ 275 PADD32(8); 276 /* 0x220 */ 277 ioport32_t cpr_coef_r; 278 ioport32_t cpr_coef_g; 279 ioport32_t cpr_coef_b; 280 ioport32_t gfx_preload; 281 282 /* 0x230 */ 283 ioport32_t vid_preload[2]; 246 284 247 285 } __attribute__((packed)) amdm37x_dispc_regs_t; … … 253 291 ASSERT(regs); 254 292 255 /* prepare sizes */ 293 printf("DISPC rev: %x\n", regs->revision); 294 295 /* Prepare sizes */ 256 296 const uint32_t size_reg = 257 297 (((x - 1) & AMDMD37X_DISPC_SIZE_WIDTH_MASK) … … 292 332 regs->config = config; 293 333 334 294 335 /* Set framebuffer base address */ 295 regs->gfx_ba[0] = pa; 296 regs->gfx_ba[1] = pa; 297 298 /* setup fb size */ 299 regs->gfx_size = size_reg; 336 regs->gfx.ba[0] = pa; 337 regs->gfx.ba[1] = pa; 338 regs->gfx.position = 0; 339 340 /* Setup fb size */ 341 regs->gfx.size = size_reg; 342 343 /* Pixel format */ 300 344 unsigned format = 0; 301 switch (bpp) { 302 case 32: 303 format = AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_RGBX; 304 case 24: 305 format = AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_RGB24; 306 break; 307 case 16: 308 format = AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_RGB16; 309 break; 310 default: 345 switch (bpp) 346 { 347 case 32: format = AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_RGBX; break; 348 case 24: format = AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_RGB24; break; 349 case 16: format = AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_RGB16; break; 350 default: 311 351 ASSERT(false); 312 352 } 313 353 314 354 /* Start gfx engine */ 315 uint32_t attribs = regs->gfx _attributes;355 uint32_t attribs = regs->gfx.attributes; 316 356 attribs &= ~(AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_MASK 317 357 << AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_SHIFT); 318 358 attribs |= format << AMDMD37X_DISPC_GFX_ATTRIBUTES_FORMAT_SHIFT; 319 359 attribs |= AMDMD37X_DISPC_GFX_ATTRIBUTES_ENABLE_FLAG; 320 regs->gfx _attributes = attribs;360 regs->gfx.attributes = attribs; 321 361 322 362 /* Enable output */ 323 363 regs->control |= AMDMD37X_DISPC_CONTROL_LCD_ENABLE_FLAG; 324 regs->control |= AMDMD37X_DISPC_CONTROL_DIGITAL_ENABLE_FLAG;364 // regs->control |= AMDMD37X_DISPC_CONTROL_DIGITAL_ENABLE_FLAG; 325 365 regs->control |= AMDMD37X_DISPC_CONTROL_GOLCD_FLAG; 326 regs->control |= AMDMD37X_DISPC_CONTROL_GODIGITAL_FLAG;366 // regs->control |= AMDMD37X_DISPC_CONTROL_GODIGITAL_FLAG; 327 367 } 328 368
Note:
See TracChangeset
for help on using the changeset viewer.