Re: Appropriate method of io remapping a single memory location?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Carlo,

On 15-05-06 09:03:32, Carlo Caione wrote:
> On Tue, May 5, 2015 at 3:29 PM,  <maitysanchayan@xxxxxxxxx> wrote:
> > Thanks for the reply. Hmm... I did not think of a DT entry as it is a
> > single location and not part of any particular peripheral. Not even
> > mentioned in the memory map.
> 
> That's why I suggested to use a syscon device.
> 
> > I tried grepping for ioremap functions instead of devm ones and saw one
> > instance and I wrote mine like this
> >
> >         rom_rev = ioremap(ROM_REVISION_REGISTER, SZ_1);
> >         if (rom_rev)
> >                 soc_dev_attr->revision = kasprintf(GFP_KERNEL, "%08x",
> >                                                 readl(rom_rev));
> >
> > Is something like this valid? Or use of devm_* functions is
> > recommeneded? Since this ioremap is gonna be called from a function
> > which is bound to the .init_machine entry of DT_MACHINE_START any harm
> > in doing this ioremap directly or the DT method would be recommended?
> 
> I guess that DT is always recommended. I would use something like
> of_find_compatible_node() + of_iomap() on the syscon device for that
> (after of_platform_populate()).
> Probably you could use also directly the physical location or a
> iotable but it is definitely uglier IMO.

Thanks for the suggestion :). I will implement accordingly.

> 
> -- 
> Carlo Caione

Regards,
Sanchayan.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux