10 Nov, 2012

1 commit

  • This bug-fix makes sure that of_address_to_resource is defined extern for sparc
    so that the sparc-specific implementation of of_address_to_resource() is once
    again used when including include/linux/of_address.h in a sparc context. A
    number of drivers in mainline relies on this function working for sparc.

    The bug was introduced in a850a7554442f08d3e910c6eeb4ee216868dda1e, "of/address:
    add empty static inlines for !CONFIG_OF". Contrary to that commit title, the
    static inlines are added for !CONFIG_OF_ADDRESS, and CONFIG_OF_ADDRESS is never
    defined for sparc. This is good behavior for the other functions in
    include/linux/of_address.h, as the extern functions defined in
    drivers/of/address.c only gets linked when OF_ADDRESS is configured. However,
    for of_address_to_resource there exists a sparc-specific implementation in
    arch/sparc/arch/sparc/kernel/of_device_common.c

    Solution suggested by: Sam Ravnborg

    Signed-off-by: Andreas Larsson
    Acked-by: Rob Herring
    Signed-off-by: David S. Miller

    Andreas Larsson
     

18 Oct, 2012

1 commit

  • drivers/of/address.c:66:29: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:66:29: expected restricted __be32 const [usertype] *cell
    drivers/of/address.c:66:29: got unsigned int [usertype] *addr
    drivers/of/address.c:87:32: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:87:32: expected restricted __be32 const [usertype] *cell
    drivers/of/address.c:87:32: got unsigned int [usertype] *addr
    drivers/of/address.c:91:30: warning: incorrect type in assignment (different base types)
    drivers/of/address.c:91:30: expected unsigned int [unsigned] [usertype]
    drivers/of/address.c:91:30: got restricted __be32 [usertype]
    drivers/of/address.c:92:22: warning: incorrect type in assignment (different base types)
    drivers/of/address.c:92:22: expected unsigned int [unsigned] [usertype]
    drivers/of/address.c:92:22: got restricted __be32 [usertype]
    drivers/of/address.c:147:35: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:147:35: expected restricted __be32 const [usertype] *addr
    drivers/of/address.c:147:35: got unsigned int [usertype] *addr
    drivers/of/address.c:157:34: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:157:34: expected restricted __be32 const [usertype] *cell
    drivers/of/address.c:157:34: got unsigned int [usertype] *
    drivers/of/address.c:256:29: warning: restricted __be32 degrades to integer
    drivers/of/address.c:256:36: warning: restricted __be32 degrades to integer
    drivers/of/address.c:262:34: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:262:34: expected restricted __be32 const [usertype] *cell
    drivers/of/address.c:262:34: got unsigned int [usertype] *
    drivers/of/address.c:372:41: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:372:41: expected restricted __be32 const [usertype] *cell
    drivers/of/address.c:372:41: got unsigned int [usertype] *addr
    drivers/of/address.c:395:53: warning: incorrect type in argument 2 (different base types)
    drivers/of/address.c:395:53: expected restricted __be32 const [usertype] *addr
    drivers/of/address.c:395:53: got unsigned int [usertype] *addr
    drivers/of/address.c:443:50: warning: incorrect type in argument 2 (different base types)
    drivers/of/address.c:443:50: expected restricted __be32 const [usertype] *addr
    drivers/of/address.c:443:50: got unsigned int *
    drivers/of/address.c:455:49: warning: incorrect type in argument 1 (different base types)
    drivers/of/address.c:455:49: expected restricted __be32 const [usertype] *cell
    drivers/of/address.c:455:49: got unsigned int *
    drivers/of/address.c:480:60: warning: incorrect type in argument 2 (different base types)
    drivers/of/address.c:480:60: expected restricted __be32 const [usertype] *addr
    drivers/of/address.c:480:60: got unsigned int *
    drivers/of/address.c:412:5: warning: symbol '__of_translate_address' was not declared. Should it be static?
    drivers/of/address.c:520:14: error: symbol 'of_get_address' redeclared with different type (originally declared at include/linux/of_address.h:22) - different base types

    Signed-off-by: Kim Phillips
    Signed-off-by: Rob Herring

    Kim Phillips
     

03 Aug, 2012

1 commit

  • It's quite legitimate for a DT node to specify #size-cells=0. One example
    is a node that's used to collect a number of non-memory-mapped devices.
    In that scenario, there may be multiple child nodes with the same name
    (type) thus necessitating the use of unit addresses in node names, and
    reg properties:

    / {
    regulators {
    compatible = "simple-bus";
    #address-cells = ;
    #size-cells = ;

    regulator@0 {
    compatible = "regulator-fixed";
    reg = ;
    ...
    };

    regulator@1 {
    compatible = "regulator-fixed";
    reg = ;
    ...
    };

    ...
    };
    };

    However, #size-cells=0 prevents translation of reg property values into
    the parent node's address space. In turn, this triggers the kernel to
    emit error messages during boot, such as:

    prom_parse: Bad cell count for /regulators/regulator@0

    To prevent printing these error messages for legitimate DT content, a
    number of changes are made:

    1) of_get_address()/of_get_pci_address() are modified only to validate
    the value of #address-cells, and not #size-cells.

    2) of_can_translate_address() is added to indicate whether address
    translation is possible.

    3) of_device_make_bus_id() is modified to name devices based on the
    translated address only where possible, and otherwise fall back to
    using the (first cell of the) raw untranslated address.

    4) of_device_alloc() is modified to create memory resources for a device
    only if the address can be translated into the CPU's address space.

    Signed-off-by: Stephen Warren
    Signed-off-by: Rob Herring

    Stephen Warren
     

16 Feb, 2012

1 commit


19 Jul, 2011

2 commits


24 Dec, 2010

1 commit

  • This patch changes u32 to __be32 for all "ranges", "prop" and "addr" and
    such. Those variables are pointing to the device tree which contains
    integers in big endian format.

    Most functions are doing it right because of_read_number() is doing the
    right thing for them. of_bus_isa_get_flags(), of_bus_pci_get_flags() and
    of_bus_isa_map() were accessing the data directly and were doing it wrong.

    Signed-off-by: Sebastian Andrzej Siewior
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Grant Likely

    Sebastian Andrzej Siewior
     

01 Aug, 2010

1 commit

  • This patch moves the declaration of of_get_address(), of_get_pci_address(),
    and of_pci_address_to_resource() out of arch code and into the common
    linux/of_address header file.

    This patch also fixes some of the asm/prom.h ordering issues. It still
    includes some header files that it ideally shouldn't be, but at least the
    ordering is consistent now so that of_* overrides work.

    Signed-off-by: Grant Likely

    Grant Likely
     

06 Jul, 2010

3 commits

  • Microblaze and PowerPC share a large chunk of code for translating
    OF device tree data into usable addresses. Differences between the two
    consist of cosmetic differences, and the addition of dma-ranges support
    code to powerpc but not microblaze. This patch moves the powerpc
    version into common code and applies many of the cosmetic (non-functional)
    changes from the microblaze version.

    Signed-off-by: Grant Likely
    Acked-by: Benjamin Herrenschmidt
    CC: Michal Simek
    CC: Wolfram Sang
    CC: Stephen Rothwell

    Grant Likely
     
  • Merge common code between PowerPC and Microblaze. This patch also
    moves the prototype of pci_address_to_pio() out of pci-bridge.h and
    into prom.h because the only user of pci_address_to_pio() is
    of_address_to_resource().

    Signed-off-by: Grant Likely
    Acked-by: Benjamin Herrenschmidt
    CC: Michal Simek
    CC: Stephen Rothwell

    Grant Likely
     
  • Merge common code between Microblaze and PowerPC. This patch creates
    new of_address.h and address.c files to containing address translation
    and mapping routines. First routine to be moved it of_iomap()

    Signed-off-by: Grant Likely
    Acked-by: Benjamin Herrenschmidt
    CC: Michal Simek
    CC: Stephen Rothwell

    Grant Likely