07 Feb, 2008

1 commit

  • Since we have mfdcri() and mtdcri() as macros, we can't use constructions,
    such as "mtdcri(base, reg, mfdcri(base, reg) | val)". In this case the
    mfdcri() stuff is not evaluated first. It's evaluated inside the mtdcri()
    macro and we have the dcr_ind_lock spinlock acquired twice.

    To avoid this error, I've added __mfdcri()/__mtdcri() inline functions that
    take the lock after register name fix-up.

    Signed-off-by: Valentine Barshak
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Josh Boyer

    Valentine Barshak
     

24 Dec, 2007

1 commit

  • Accessing indirect DCRs is done via a pair of address/data DCRs.

    Such accesses are thus inherently racy, vs. interrupts, preemption
    and possibly SMP if 4xx SMP cores are ever used.

    This updates the mfdcri/mtdcri macros in dcr-native.h (which were
    so far unused) to use a spinlock.

    In addition, add some common definitions to a new dcr-regs.h file.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Josh Boyer

    Benjamin Herrenschmidt
     

16 Oct, 2007

2 commits

  • With the base stored in dcr_host_t, there's no need for callers to pass
    the dcr_n into dcr_unmap(). In fact this removes the possibility of them
    passing the incorrect value, which would then be iounmap()'ed.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Jeff Garzik

    Michael Ellerman
     
  • Now that all users of dcr_read()/dcr_write() add the dcr_host_t.base, we
    can save them the trouble and do it in dcr_read()/dcr_write().

    As some background to why we just went through all this jiggery-pokery,
    benh sayeth:

    Initially the goal of the dcr_read/dcr_write routines was to operate like
    mfdcr/mtdcr which take absolute DCR numbers. The reason is that on 4xx
    hardware, indirect DCR access is a pain (goes through a table of
    instructions) and it's useful to have the compiler resolve an absolute DCR
    inline.

    We decided that wasn't worth the API bastardisation since most places
    where absolute DCR values are used are low level 4xx-only code which may
    as well continue using mfdcr/mtdcr, while the new API is designed for
    device "instances" that can exist on 4xx and Axon type platforms and may
    be located at variable DCR offsets.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Jeff Garzik

    Michael Ellerman
     

03 Oct, 2007

1 commit

  • In its current form, dcr_map() doesn't remember the base address you passed
    it, which means you need to store it somewhere else. Rather than adding the
    base to another struct it seems simpler to store it in the dcr_host_t.

    Signed-off-by: Michael Ellerman
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     

16 Feb, 2007

1 commit

  • Getting BenH's new EMAC driver working on 440GP, I found some more
    problems in the native mode paths of the new DCR code:
    - dcr_map() is supposed to return a dcr_host_t, but the native
    version is a macro that doesn't expand to an expression. With native
    DCRs, dcr_host_t is an empty structure, so we just use a constructor
    expression instead.
    - dcr_unmap() uses {} instead of the safer do {} while (0)
    idiom to implement a no-op

    Here's a fix.

    Signed-off-by: David Gibson
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    David Gibson
     

11 Dec, 2006

1 commit


04 Dec, 2006

1 commit

  • This patch adds new dcr_map/dcr_read/dcr_write accessors for DCRs that
    can be used by drivers to transparently address either native DCRs or
    memory mapped DCRs. The implementation for memory mapped DCRs is done
    after the binding being currently worked on for SLOF and the Axon
    chipset. This patch enables it for the cell native platform

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt