<div class="gmail_quote">On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net" target="_blank">c-d.hailfinger.devel.2006@gmx.net</a>></span> wrote:<br>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>2-3-add_arm_isms.patch</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Have you checked with an architecture guru that sync_primitive() can<br>
really be empty, not only for that arch in general, but also for<br>
accesses to a mmapped region the way flashrom does it?<br></blockquote><div><br></div><div>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.</div>

<div><br></div><div>I'm pretty new to ARM... Any advice from experts on this list would be appreciated.</div>




<div><br></div><div>On Tue, Jun 28, 2011 at 5:54 PM, Carl-Daniel Hailfinger <span dir="ltr"><<a href="mailto:c-d.hailfinger.devel.2006@gmx.net" target="_blank">c-d.hailfinger.devel.2006@gmx.net</a>></span> wrote: </div>






<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">3-3-add_tegra2_spi_controller.patch<br>
Not your fault, but we really need a way to detect the target<br>
architecture in the Makefile. The issues of which SPI masters to include<br>
for internal exists on all architectures. Any ideas? I experimented with<br>
uname calls in the past, but that checks the host arch, not the target<br>
arch. Grepping the preprocessor output for the compiler might be an option.<br>
echo|gcc -dM -E -|grep "whatever\|arch\|defines"<br>
Or you try this pretty straightforward solution:<br>
<br>
Create a file arch.h with these contents:<br>
#if defined (__i386__)<br>
#define __FLASHROM_ARCH__ "x86"<br>
#elif defined (__x86_64__)<br>
#define __FLASHROM_ARCH__ "x86_64"<br>
#elif defined (__mips) || defined (__mips__) || defined (_mips) ||<br>
defined (mips)<br>
#define __FLASHROM_ARCH__ "mips"<br>
#elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__)<br>
|| defined(__ppc64__)<br>
#define __FLASHROM_ARCH__ "ppc"<br>
#endif<br>
__FLASHROM_ARCH__<br>
<br>
Then run<br>
gcc -E arch.h|grep -v ^#<br>
The result on my machine will be<br>
"x86"<br>
Side note: Such an arch.h file (with some extensions) might save us from<br>
having to check every possible arch define everywhere we need to<br>
differentiate between architectures.<br>
<br>
I will comment on the Tegra2 SPI driver later, we should get the<br>
infrastructure questions addressed first.</blockquote><div><br></div><div>I've updated this patch set on top of the other patches you've been working on (<a href="http://patchwork.coreboot.org/patch/3256/">autodetect target processor</a> and the <a href="http://patchwork.coreboot.org/patch/3255/ ">libpci hack</a>).</div>

<div><br></div><div>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</div>

<div><br></div><div>New patches are:</div><div>Signed-off-by: David Hendricks <<a href="mailto:dhendrix@google.com">dhendrix@google.com</a>></div></div><br>-- <br>David Hendricks (dhendrix)<br>Systems Software Engineer, Google Inc.<br>