
Dear Anatolij Gustschin,
In message 1277815514-32120-1-git-send-email-agust@denx.de you wrote:
Unaligned 32-/16-bit accesses to local bus on MPC5200 and MPC512x deliver corrupted data:
Right, and the current version of print_buffer() shopws the real data, i. e. you can see that such a corruption happens.
Use memcpy in print_buffer() to fix the problem.
NAK. This violates the design of the command.
for (i = 0; i < linelen; i++) { if (width == 4) {
The "width == 4" part means that we want to access the memory with 32 bit accesses - nothing else.
+#if defined(CONFIG_MPC5200) || defined(CONFIG_MPC512X)
/*
* workaround for issues on the MPC5200/MPC512X,
* where unaligned 32-/16-bit-accesses to the
* local bus will deliver corrupted data. Just
* use fixed memcpy here.
*/
memcpy(&uip[i], data, 4);
+#else uip[i] = *(volatile uint32_t *)data; +#endif
If we would go this route, we could drop the #ifdef and always perform a memcpy(), but then we have absolutley no guarantee about which kind of accesses would be used.
No, please leave as is - this part of U-Boot is working exactly as intended.
Best regards,
Wolfgang Denk