Information regarding Device Tree

2014-06-02 Thread JAYESH TANK
Hi All,
  I would like to write script to get Windows Device Manager like
functionality to check all the devices present on my Linux machine. What
all are the ways to get about this, is iterating sysfs is the way? Or is
there any other elegant way?

Thanks for support.
Jayesh Kumar
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: pci_iomap() and pci_ioremap_bar()

2013-06-27 Thread JAYESH TANK
AFAIK, pci_ioremap_bar api provides an error-proof way (relative to
pci_ioremap) for PCI memory remap.

After the mapping is successful, in case you are writing a portable code,
use ioread8 api which provides platform abstraction to the re mapped
registers.

Hope that helps.

BR,
Jayesh


On Wed, Jun 26, 2013 at 12:42 PM, Warlich, Christof <
christof.warl...@siemens.com> wrote:

> Hi,
>
> can anyone explain when I should use
>
> void __iomem *regs = pci_iomap(device, barNumber, 0);
>
> and when
>
> void __iomem *regs = pci_ioremap_bar(device, barNumber);
>
> is more appropriate to map PCI memory?
>
> Furthermore, after the mapping succeeded, when may I
> directly access the mapped memory, e.g.:
>
> char firstByte = *regs;
>
> and when should I better use ioread8() instead?:
>
> char firstBype = ioread8(regs);
>
> All listed alternatives from above seems to work equally
> well for me (on x86), so I'm curious to learn what might
> be the difference. A guess: Does ioread8() work for both
> memory mapped _and_ IO mapped registers, while the direct
> access only works for the memory mapped case?
>
> Thanks for any clarification.
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Query regarding ZRELADDR, ZTEXTADDR and zImage.

2012-04-17 Thread JAYESH TANK
Hope this helps:  http://www.kernelport.org/kernelport/defines.html

Cheers... :)


On Tue, Apr 17, 2012 at 7:10 PM, KARTHIK SEKURU wrote:

> Hi,
> I'm doing kernel porting to arm926 based FPGA board,very minimal setup
> (uart + timer only)
>
> Below are the details
>
> #define PLAT_PHYS_OFFSET   0x8000 (with 128 MB SDRAM)
> #define CONFIG_PAGE_OFFSET  0xc000
>
>
> Physical memory : 128MB (0x8000 to 8800)
>
> ZRELADDR = 0x80008000
> PARAMS_PHYS = 0x8100
> INITRD_PHYS = 0x8080
>
> Kernel cmd line : mem=32M console=ttySAC0,115200 root=/dev/ram0
> rootfstype=cramfs init=/linuxrc initrd=0x8080,8M user_debug=31
>
>
>
>
>
> I am not using u-boot and doing all the required initializations through
> trace32 cmm script.
>
> Through trace32 I am loading the zImage at 0x80008000.After this I am
> getting the following error..
>
>
>
>
>
> *Uncompressing Linux...*
>
> * *
>
> *uncompression error*
>
> * *
>
> * -- System halted*
>
>
>
>
>
> My doubt is …
>
> ZRELADDR in “Makefile.boot” is set to 0x80008000,i.e the start address of
> the “decompressed zImage”..
>
> And through cmm script I am also loading the “compressed zImage” at the
> same location 0x80008000.
>
> Am I mentioning the source address and destination address as same.i.e the
> compressed zImage and decompressed zImage address are same? Is that OK?
>
>
> ZTEXTADDR:
>
> Start address of decompressor. Is it the address where i should
> load "compressed zImage". ??
>
>
>
> The “compressed zImage” is decompressed via the function
> decompress_kernel();
>
>
>
> Void decompress_kernel()
>
> {
>
> …
>
> …
>
>
>
> putstr("Uncompressing Linux...");
>
> ret = do_decompress(input_data, input_data_end - input_data,
>
> output_data, error);
> …
>
> …
>
> }
>
> I understand that the arguments going to the function do_decompress() .,
> input_data,input_data_end and output_data are related to zImage address.
>
> Please help me in getting clear understanding about these arguments ??
> What does they mean exactly ??
>
>
>
>
>
> Kindly help me in resolving this uncompression error.
>
>
>
> Karthik.
>
>
>
>
>
>
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Question about tlv message support

2012-04-16 Thread JAYESH TANK
Hi All,
  I have the answer of that general question.. :)

afaik, this link has listed all the api's which linux kernel supports:
http://www.gnugeneration.com/books/linux/2.6.20/kernel-api/

You can very well go through it and check for certain api availability. As
a point to note, it has api s for 2.6.20 kernel.

Enjoy!!

On Tue, Apr 17, 2012 at 6:06 AM, NorthPole  wrote:

> @JAYESH TANK
> thank you very much :-) that was a very good starting poind :D
>
>
> @Javier
> you are right, so here is something more specific
>
> I want to add a framework for tlv message construction and parsing in
> a wireless mesh routing protocol so as it can have the advantages of
> the tlv way of communication (one of which is backwards compatibility)
>
> afaik tlvs are used in many places in the kernel and as Jayesh stated
> there are no ready made apis.
> So if I want to do that I have to copy someone else's code and modify
> it accordingly
>
> but I have another general question:
> In the future if I want to find if the kernel has internal support for
> the X thing how can I find out if it has and how it does support?
>
>
>
> On Tue, Apr 17, 2012 at 3:17 AM, Javier Martinez Canillas
>  wrote:
> > On Mon, Apr 16, 2012 at 3:00 PM, NorthPole 
> wrote:
> >> thx Javier
> >> But isnt the api for use in the user space?
> >> I need something for use in kernel space
> >>
> >
> > What exactly do you want to do?
> >
> > Generic Netlink can be used to communicate both user-space and kernel
> > code, but you will have general answer to general questions :)
> >
> > --
> > Javier Martínez Canillas
> > (+34) 682 39 81 69
> > Barcelona, Spain
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Question about tlv message support

2012-04-16 Thread JAYESH TANK
Hi,
I could not locate ready made APIs for TLV construction and encoding but a
more generic implementation/functions can be seen in
include/linux/tipc_config.h file.
Hope that helps.

-Jayesh Kumar
"You don't know, until you know."


On Mon, Apr 16, 2012 at 6:30 PM, NorthPole  wrote:

> thx Javier
> But isnt the api for use in the user space?
> I need something for use in kernel space
>
> On Mon, Apr 16, 2012 at 3:30 PM, Javier Martinez Canillas
>  wrote:
> > On Fri, Apr 13, 2012 at 8:22 PM, NorthPole 
> wrote:
> >> Hello everyone
> >>
> >> I'm completely new to linux kernel and I would be grateful if you
> >> could help me get started.
> >> I read some basic things about the kernel. But I couldnt find anything
> >> relevant to the question below.
> >>
> >> So: Does the kernel have any support for the construction and encoding
> >> of type/length/value (TLV) or other information element messages?
> >>  if it has(or if you dont know) where can I find a list or more
> documentation?
> >>
> >
> > I think what you are looking for is the Generic Netlink API.
> >
> > Here is a good howto:
> >
> http://www.linuxfoundation.org/collaborate/workgroups/networking/genericnetlinkhowto
> >
> > Hope it helps,
> >
> > --
> > Javier Martínez Canillas
> > (+34) 682 39 81 69
> > Barcelona, Spain
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies