Hello,
thank your for the excellent bug report and your investigation. We could reproduce the issue.
The root cause turned out to be somewhere else, more specifically it is an uninitialized member variable in core's I/O-memory 'Dataspace_attr'. With the old Fiasco.OC version, this bug did not trigger because memory was never mapped as write combined. Revision 40 of the kernel fixes that and consequently triggered the bug in core. The fix is available in the master branch. Here is the patch for reference:
https://github.com/genodelabs/genode/commit/077573015574f9df5edddede9a2ad709...
Thanks again! Norman
On 10/04/2012 12:05 PM, i.ismagilov wrote:
*_Bug:_*
SD service of Genode master branch _for Fiasco.OC / PandaBoard_ doesn’t start with *"SD command error"* (occurs in /os/src/drivers/sd_card/omap4/mmchs.h/:824).
*_ _*
*_Description:_**__*
L4_FPAGE_BUFFERABLE constant (/base-foc/src/base/ipc/pager.cc/:91) is used to configure I/O memory region.
In *Fiasco.OC *this constant is prepared as Page::*BUFFERED* (/base-foc/contrib/kernel/fiasco/src/kern/arm/paging-arm.cpp/:65).
In *Fiasco.OC revision* *38* this constant is equal to *0x04* (for both ARMv6 and ARMv7).
In revision 40 it was changed to *0x40*.
This modification causes SD card driver error (and possible other driver errors) for ARMv6 and v7 architectures.
*0x04*value seems to correspond to *‘Device’ memory type* (for I/O). Memory pages corresponding to I/O are non-cacheable.
*0x40*value is seems for ‘Normal’ memory type. *Pages are cached* in this case but *this is not allowed for I/O* and causes SD card error.
*_Solutions:_*
Page::*BUFFERED* constant seems to be _used for I/O only_, not
for RAM (currently). So, we propose to set Page::BUFFERED constant to 0x40 in rev. 40 as it was in rev. 38 (*see attached patch*).
If Page::BUFFERED constant is planned to use _for RAM memory
also_, some other constant for I/O memory pages configuring and related workaround in Genode driver to be added.