Changeset ee685630 in mainline
- Timestamp:
- 2012-04-11T17:43:37Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0747468
- Parents:
- 179f6f2
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
HelenOS.config
r179f6f2 ree685630 537 537 @ "1920x1080" 538 538 @ "1920x1200" 539 ! [(PLATFORM=ia32|PLATFORM=amd64 )&CONFIG_HID_OUT!=none&CONFIG_FB=y] CONFIG_BFB_MODE (choice)539 ! [(PLATFORM=ia32|PLATFORM=amd64|MACHINE=beagleboardxm)&CONFIG_HID_OUT!=none&CONFIG_FB=y] CONFIG_BFB_MODE (choice) 540 540 541 541 % Default framebuffer depth … … 543 543 @ "16" 544 544 @ "24" 545 ! [(PLATFORM=ia32|PLATFORM=amd64 )&CONFIG_HID_OUT!=none&CONFIG_FB=y] CONFIG_BFB_BPP (choice)545 ! [(PLATFORM=ia32|PLATFORM=amd64|MACHINE=beagleboardxm)&CONFIG_HID_OUT!=none&CONFIG_FB=y] CONFIG_BFB_BPP (choice) 546 546 547 547 % Start AP processors by the loader -
defaults/arm32/beagleboardxm/Makefile.config
r179f6f2 ree685630 6 6 7 7 #framebuffer 8 CONFIG_FB = n 8 CONFIG_FB = y 9 10 CONFIG_BFB_MODE = 1024x768 11 CONFIG_BFB_BPP = 24 -
kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c
r179f6f2 ree685630 38 38 #include <genarch/drivers/amdm37x_uart/amdm37x_uart.h> 39 39 #include <genarch/drivers/amdm37x_gpt/amdm37x_gpt.h> 40 #include <genarch/drivers/amdm37x_dispc/amdm37x_dispc.h> 41 #include <genarch/fb/fb.h> 40 42 #include <genarch/srln/srln.h> 41 43 #include <interrupt.h> … … 59 61 60 62 static struct beagleboard { 63 amdm37x_dispc_regs_t *dispc; 61 64 amdm37x_irc_regs_t *irc_addr; 62 65 amdm37x_uart_t uart; … … 82 85 } 83 86 87 static void bbxm_setup_fb(unsigned width, unsigned height, unsigned bpp) 88 { 89 const unsigned pixel_bytes = (bpp / 8); 90 const size_t size = ALIGN_UP(width * height * pixel_bytes, FRAME_SIZE); 91 const unsigned frames = size / FRAME_SIZE; 92 unsigned order = 0; 93 unsigned frame = 1; 94 while (frame < frames) { 95 frame *= 2; 96 ++order; 97 } 98 printf("Allocating %d (2^%d) frames.\n", size, order); 99 /* prefer highmem as we don't care about virtual mapping. */ 100 void *buffer = frame_alloc(order, FRAME_LOWMEM); 101 ASSERT(buffer); 102 103 amdm37x_dispc_setup_fb(beagleboard.dispc, width, height, bpp, 104 (uintptr_t) buffer); 105 106 fb_properties_t prop = { 107 .addr = (uintptr_t)buffer, 108 .offset = 0, 109 .x = width, 110 .y = height, 111 .scan = width * pixel_bytes, 112 .visual = VISUAL_RGB_5_6_5_LE 113 }; 114 switch (bpp) 115 { 116 case 8: 117 prop.visual = VISUAL_INDIRECT_8; break; 118 case 16: 119 prop.visual = VISUAL_RGB_5_6_5_LE; break; 120 case 24: 121 prop.visual = VISUAL_RGB_8_8_8; break; 122 case 32: 123 prop.visual = VISUAL_RGB_8_8_8_0; break; 124 default: 125 printf("Invalid framebuffer bit depth: bailing out.\n"); 126 return; 127 } 128 outdev_t *fb_dev = fb_init(&prop); 129 if (fb_dev) 130 stdout_wire(fb_dev); 131 132 } 133 84 134 static void bb_timer_irq_handler(irq_t *irq) 85 135 { … … 100 150 (void *) km_map(AMDM37x_IRC_BASE_ADDRESS, AMDM37x_IRC_SIZE, 101 151 PAGE_NOT_CACHEABLE); 152 ASSERT(beagleboard.irc_addr); 102 153 amdm37x_irc_init(beagleboard.irc_addr); 103 154 155 /* Map display controller */ 156 beagleboard.dispc = (void*) km_map(AMDM37x_DISPC_BASE_ADDRESS, 157 AMDM37x_DISPC_SIZE, PAGE_NOT_CACHEABLE); 158 ASSERT(beagleboard.dispc); 104 159 105 160 /* Initialize timer, pick timer1, because it is in always-power domain … … 167 222 { 168 223 #ifdef CONFIG_FB 169 #error "Frame buffer is not yet supported!" 224 bbxm_setup_fb(CONFIG_BFB_WIDTH, CONFIG_BFB_HEIGHT, CONFIG_BFB_BPP); 225 #else 226 (void)bbxm_setup_fb; 170 227 #endif 171 228 /* UART3 is wired to external RS232 connector */
Note:
See TracChangeset
for help on using the changeset viewer.