[flashrom] [Patch] NVIDIA Tegra2 SPI controller support

David Hendricks dhendrix at google.com
Thu Jul 7 02:32:11 CEST 2011


On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger <
c-d.hailfinger.devel.2006 at gmx.net> wrote:

> 2-3-add_arm_isms.patch
>
Have you checked with an architecture guru that sync_primitive() can
> really be empty, not only for that arch in general, but also for
> accesses to a mmapped region the way flashrom does it?
>

Nope. Scattered resources/forum posts about ARMv7 suggest that peripheral
memory is strongly ordered. Also, the U-Boot code doesn't have special
handling for sync primitives AFAICT.

I'm pretty new to ARM... Any advice from experts on this list would be
appreciated.

On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger <
c-d.hailfinger.devel.2006 at gmx.net> wrote:

> 3-3-add_tegra2_spi_controller.patch
> Not your fault, but we really need a way to detect the target
> architecture in the Makefile. The issues of which SPI masters to include
> for internal exists on all architectures. Any ideas? I experimented with
> uname calls in the past, but that checks the host arch, not the target
> arch. Grepping the preprocessor output for the compiler might be an option.
> echo|gcc -dM -E -|grep "whatever\|arch\|defines"
> Or you try this pretty straightforward solution:
>
> Create a file arch.h with these contents:
> #if defined (__i386__)
> #define __FLASHROM_ARCH__ "x86"
> #elif defined (__x86_64__)
> #define __FLASHROM_ARCH__ "x86_64"
> #elif defined (__mips) || defined (__mips__) || defined (_mips) ||
> defined (mips)
> #define __FLASHROM_ARCH__ "mips"
> #elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__)
> || defined(__ppc64__)
> #define __FLASHROM_ARCH__ "ppc"
> #endif
> __FLASHROM_ARCH__
>
> Then run
> gcc -E arch.h|grep -v ^#
> The result on my machine will be
> "x86"
> Side note: Such an arch.h file (with some extensions) might save us from
> having to check every possible arch define everywhere we need to
> differentiate between architectures.
>
> I will comment on the Tegra2 SPI driver later, we should get the
> infrastructure questions addressed first.


I've updated this patch set on top of the other patches you've been working
on (autodetect target processor <http://patchwork.coreboot.org/patch/3256/>
 and the libpci hack <http://patchwork.coreboot.org/patch/3255/>).

The difference between this patchset and the previous one is pretty minor.
We can now discard the first patch which #ifdef'd out PCI code for ARM
targets. The remaining differences are mostly centered around the Makefile
and arch.h

New patches are:
Signed-off-by: David Hendricks <dhendrix at google.com>

-- 
David Hendricks (dhendrix)
Systems Software Engineer, Google Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20110706/430b8a4e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1-2-add_arm_support.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20110706/430b8a4e/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2-2-add_tegra2_spi_controller.patch
Type: text/x-patch
Size: 19029 bytes
Desc: not available
URL: <http://www.flashrom.org/pipermail/flashrom/attachments/20110706/430b8a4e/attachment-0001.patch>


More information about the flashrom mailing list