lkml.org 
[lkml]   [2008]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2 v4] Add DIU platform code for MPC8610HPCD
York Sun wrote:
> + np = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis");
> + if (np) {
> + of_address_to_resource(np, 0, &r);
> + of_node_put(np);
> + pixis_bdcfg0 = ioremap(r.start + 0x00000008, sizeof(u8));
> + if (!pixis_bdcfg0) {
> + printk(KERN_ERR "Err: can't map FPGA cfg register!\n");
> + return;
> + }
> + pixis_arch = ioremap(r.start + 0x00000001, sizeof(u8));
> + if (!pixis_arch) {
> + printk(KERN_ERR "Err: can't map FPGA arch register!\n");
> + return;
> + }

Just of_iomap() the whole resource, rather than doing it a byte at a time.

> +int __init preallocate_diu_videomemory(void)
> +{
> + pr_debug("diu_size=%lu\n", diu_ops.diu_size);
> +
> + diu_ops.diu_mem = __alloc_bootmem(diu_ops.diu_size, 8, 0);
> + if (!diu_ops.diu_mem) {
> + printk(KERN_ERR "fsl-diu: cannot allocate %lu bytes\n",
> + diu_ops.diu_size);
> + return -ENOMEM;
> + }
> +
> + printk(KERN_INFO "%s: diu_mem=%p\n", __func__, diu_ops.diu_mem);

The pr_debug line is more useful information than the KERN_INFO line...

-Scott


\
 
 \ /
  Last update: 2008-03-28 18:23    [W:0.072 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site