Esempio n. 1
0
static int kp_probe(const char *name)
{
  if (strcmp("OMAP_KP", name))
    {
      printf("[KEYP] I'm not the right driver for %s\n", name);
      return 0;
    }
  return !l4io_lookup_device("OMAP_KP", NULL, 0, 0);
}
Esempio n. 2
0
static int lcd_probe(const char *configstr)
{
	lcd_mode = MODE_BEAGLEBOARD;

	if (configstr && (strstr(configstr, "evm") || strstr(configstr, "init")))
		lcd_mode = MODE_EVM;

	if (configstr && (strstr(configstr, "overo")))
		lcd_mode = MODE_OVERO;

	return !l4io_lookup_device("OMAP_LCD", NULL, 0, 0);
}
Esempio n. 3
0
static int lcd_probe(const char *configstr)
{
    (void)configstr;
    return !l4io_lookup_device("FBMEM", NULL, 0, 0);
}
Esempio n. 4
0
int
ux_probe(con_accel_t *accel)
{
  struct l4_vhw_descriptor *vhw;
  struct l4_vhw_entry *vhwe;

  if (!l4util_kip_kernel_is_ux(l4re_kip()))
    return -L4_ENODEV;

  if (l4io_lookup_device("L4UXfb", NULL, 0, 0))
    {
      printf("WARNING: Running under Fiasco-UX and no 'L4UXfb' device found, can only use polling mode!\n");
      return -L4_ENODEV;
    }

  printf("Found Fiasco-UX Framebuffer\n");

  if (!(vhw = l4_vhw_get(l4re_kip())))
    return -L4_ENODEV;

  if (!(vhwe = l4_vhw_get_entry_type(vhw, L4_TYPE_VHW_FRAMEBUFFER)))
    return -L4_ENODEV;

  ux_con_pid = vhwe->provider_pid;
  accel->drty = uxScreenUpdate;
  accel->caps = ACCEL_POST_DIRTY;

  printf("Found VHW descriptor, provider is %d\n", ux_con_pid);

  l4_thread_control_start();
  l4_thread_control_ux_host_syscall(1);
  l4_thread_control_commit(l4re_env()->main_thread);

  /* The update thread needs to run with the same priority than as the vc
   * threads (otherwise the screen won't be updated) */
  {
    pthread_t update_tid;
    pthread_attr_t a;
    struct sched_param sp;

    pthread_attr_init(&a);
    sp.sched_priority = 0x70;
    pthread_attr_setschedpolicy(&a, SCHED_L4);
    pthread_attr_setschedparam(&a, &sp);
    pthread_attr_setinheritsched(&a, PTHREAD_EXPLICIT_SCHED);

    if (pthread_create(&update_tid, &a, updater_thread, NULL))
       return -L4_ENOMEM;
    updater_id = pthread_getl4cap(update_tid);

#if 0
    update_tid = l4thread_create_long(L4THREAD_INVALID_ID,
                                      updater_thread, ".scr-upd",
                                      L4THREAD_INVALID_SP, L4THREAD_DEFAULT_SIZE,
                                      0xff, NULL,
                                      L4THREAD_CREATE_ASYNC);
    if (update_tid < 0)
      {
        printf("Could not create updater thread.\n");
        return -L4_ENOTHREAD;
      }

    updater_id = l4thread_l4_id(update_tid);
#endif
  }

#if 0
  if (hw_vid_mem_addr != vhwe->mem_start
      || hw_vid_mem_size != vhwe->mem_size)
    printf("!!! Memory area mismatch "l4_addr_fmt"(%lx) vs. "l4_addr_fmt
           "(%lx) ... continuing\n",
           hw_vid_mem_addr, hw_vid_mem_size, vhwe->mem_start, vhwe->mem_size);
#endif

  //map_io_mem(hw_vid_mem_addr, hw_vid_mem_size, 0, "UX video",
   //          (l4_addr_t *)&hw_map_vid_mem_addr);

  // already mapped by vesa-ds + rm-attach
  hw_map_vid_mem_addr = hw_vid_mem_addr;

  return 0;
}
Esempio n. 5
0
static int arm_lcd_h3800_probe(const char *configstr)
{
  (void)configstr;
  return !l4io_lookup_device("H3800 LCD", NULL, 0, 0);
}
Esempio n. 6
0
static int probe(const char *c)
{
  config(c);

  return !l4io_lookup_device("AMBA PL110", NULL, 0, 0);
}
Esempio n. 7
0
static void setup_memory(void)
{
  l4_size_t phys_size;
  l4io_device_handle_t dh;
  l4io_resource_handle_t hdl;

  if (fb_vaddr)
    return;

  if (l4io_lookup_device("System Control", &dh, 0, &hdl))
    {
      printf("Could not get system controller space\n");
      return;
    }

  /* System controller -- XXX Wrong Place XXX */
  amba_pl110_sys_base_virt
    = l4io_request_resource_iomem(dh, &hdl);
  if (amba_pl110_sys_base_virt == 0)
    {
      printf("Could not map system controller space\n");
      return;
    }

  if (l4io_lookup_device("AMBA PL110", &dh, 0, &hdl))
    {
      printf("Could not get PL110 LCD device\n");
      return;
    }

  amba_pl110_lcd_control_virt_base
    = l4io_request_resource_iomem(dh, &hdl);
  if (amba_pl110_lcd_control_virt_base == 0)
    {
      printf("Could not map controller space for '%s'\n", arm_lcd_get_info());
      return;
    }

  setup_type();

  if ((read_sys_reg(Reg_sys_clcd) & Sys_clcd_idmask) == 0x1000)
    {
      is_qemu = 1; // remember if we run on qemu because of the different
                   // handling of the bpp16 mode with PL110: my hardware has
                   // 5551 mode, qemu does 565
      type = PL111; // also set the type to PL111 because qemu only
                    // announces a PL110 but can do the 1024 resolution too
      printf("Running on QEmu (assuming PL111).\n");
    }

  if (config_request_xga && type == PL111)
    use_xga = 1;

  // get some frame buffer
  l4re_ds_t mem = l4re_util_cap_alloc();
  if (l4_is_invalid_cap(mem))
    return;

  if (l4re_ma_alloc(fbmem_size(), mem, L4RE_MA_CONTINUOUS | L4RE_MA_PINNED))
    {
      printf("Error allocating memory\n");
      return;
    }

  fb_vaddr = 0;
  if (l4re_rm_attach(&fb_vaddr, fbmem_size(),
                     L4RE_RM_SEARCH_ADDR | L4RE_RM_EAGER_MAP,
                     mem, 0, L4_PAGESHIFT))
    {
      printf("Error getting memory\n");
      return;
    }

  printf("Video memory is at virtual %p (size: 0x%x Bytes)\n",
         fb_vaddr, fbmem_size());

  // get physical address
  if (l4re_ds_phys(mem, 0, &fb_paddr, &phys_size)
      || phys_size != fbmem_size())
    {
      printf("Getting the physical address failed or not contiguous\n");
      return;
    }
  printf("Physical video memory is at %p\n", (void *)fb_paddr);
}