Lines Matching +full:bcm2835 +full:- +full:firmware

1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
53 #include <arm/broadcom/bcm2835/bcm2835_mbox_prop.h>
68 {"broadcom,bcm2835-fb", 1},
69 {"brcm,bcm2708-fb", 1},
88 if (fb->bpp < FB_DEPTH) { in bcm_fb_init()
89 device_printf(sc->dev, "changing fb bpp from %d to %d\n", in bcm_fb_init()
90 fb->bpp, FB_DEPTH); in bcm_fb_init()
91 fb->bpp = FB_DEPTH; in bcm_fb_init()
93 device_printf(sc->dev, "keeping existing fb bpp of %d\n", in bcm_fb_init()
94 fb->bpp); in bcm_fb_init()
96 fb->vxres = fb->xres; in bcm_fb_init()
97 fb->vyres = fb->yres; in bcm_fb_init()
98 fb->xoffset = fb->yoffset = 0; in bcm_fb_init()
101 device_printf(sc->dev, "bcm2835_mbox_fb_init failed, err=%d\n", in bcm_fb_init()
120 memset(&sc->info, 0, sizeof(sc->info)); in bcm_fb_setup_fbd()
121 sc->info.fb_name = device_get_nameunit(sc->dev); in bcm_fb_setup_fbd()
123 sc->info.fb_vbase = (intptr_t)pmap_mapdev(fb.base, fb.size); in bcm_fb_setup_fbd()
124 sc->info.fb_pbase = fb.base; in bcm_fb_setup_fbd()
125 sc->info.fb_size = fb.size; in bcm_fb_setup_fbd()
126 sc->info.fb_bpp = sc->info.fb_depth = fb.bpp; in bcm_fb_setup_fbd()
127 sc->info.fb_stride = fb.pitch; in bcm_fb_setup_fbd()
128 sc->info.fb_width = fb.xres; in bcm_fb_setup_fbd()
129 sc->info.fb_height = fb.yres; in bcm_fb_setup_fbd()
131 sc->info.fb_flags = FB_FLAG_MEMATTR; in bcm_fb_setup_fbd()
132 sc->info.fb_memattr = VM_MEMATTR_WRITE_COMBINING; in bcm_fb_setup_fbd()
135 if (sc->fbswap) { in bcm_fb_setup_fbd()
136 switch (sc->info.fb_bpp) { in bcm_fb_setup_fbd()
138 vt_config_cons_colors(&sc->info, in bcm_fb_setup_fbd()
140 sc->info.fb_cmsize = 16; in bcm_fb_setup_fbd()
143 vt_config_cons_colors(&sc->info, in bcm_fb_setup_fbd()
145 sc->info.fb_cmsize = 16; in bcm_fb_setup_fbd()
150 fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev)); in bcm_fb_setup_fbd()
152 device_printf(sc->dev, "Failed to add fbd child\n"); in bcm_fb_setup_fbd()
153 pmap_unmapdev((void *)sc->info.fb_vbase, sc->info.fb_size); in bcm_fb_setup_fbd()
156 device_printf(sc->dev, "Failed to attach fbd device\n"); in bcm_fb_setup_fbd()
157 device_delete_child(sc->dev, fbd); in bcm_fb_setup_fbd()
158 pmap_unmapdev((void *)sc->info.fb_vbase, sc->info.fb_size); in bcm_fb_setup_fbd()
162 device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n", fb.xres, fb.yres, in bcm_fb_setup_fbd()
164 device_printf(sc->dev, in bcm_fb_setup_fbd()
166 sc->fbswap, fb.pitch, fb.base, fb.size); in bcm_fb_setup_fbd()
181 if (err || !req->newptr) /* error || read request */ in bcm_fb_resync_sysctl()
199 ctx = device_get_sysctl_ctx(sc->dev); in bcm_fb_sysctl_init()
200 tree_node = device_get_sysctl_tree(sc->dev); in bcm_fb_sysctl_init()
211 if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) in bcm_fb_probe()
214 device_set_desc(dev, "BCM2835 VT framebuffer driver"); in bcm_fb_probe()
228 sc->dev = dev; in bcm_fb_attach()
230 /* Newer firmware versions needs an inverted color palette. */ in bcm_fb_attach()
231 sc->fbswap = 0; in bcm_fb_attach()
233 if (chosen != -1 && in bcm_fb_attach()
242 sc->fbswap = 1; in bcm_fb_attach()
262 return (&sc->info); in bcm_fb_helper_getinfo()