01:46
<
f_ridge >
<clever___/D> after studying linux and the pdf for a few hours, i figured out how to make sense of page 81 and table 4-11`
02:02
Ad0 has quit [Ping timeout: 252 seconds]
02:37
Ad0 has joined ##raspberrypi-internals
02:40
jcea has quit [Ping timeout: 240 seconds]
02:51
srk has joined ##raspberrypi-internals
03:47
<
f_ridge >
<clever___/D> got CMD6 query working
03:48
<
f_ridge >
<clever___/D> ```
03:48
<
f_ridge >
<clever___/D> bool BCM2708SDHost::send_raw(uint32_t, uint32_t):135: CMD 6, arg=0xfffff0
03:48
<
f_ridge >
<clever___/D> bool BCM2708SDHost::wait_and_get_response():276: Cmd: 6 Resp: 00000900 0000066e ffffffff ffffffff 0x01806400 0x01800180 0x01800180 0x00000380 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xc01edc78 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xc01edc78 0x00000001 0x00090000 0
03:48
<
f_ridge >
<clever___/D> ```
03:48
<
f_ridge >
<clever___/D> ```
03:48
<
f_ridge >
<clever___/D> bool BCM2708SDHost::send_raw(uint32_t, uint32_t):135: CMD 6, arg=0xfffff0
03:48
<
f_ridge >
<clever___/D> bool BCM2708SDHost::wait_and_get_response():276: Cmd: 6 Resp: 00000900 0000066e ffffffff ffffffff
03:48
<
f_ridge >
<clever___/D> 0x01806400 0x01800180 0x01800180 0x00000380 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xc01edc78 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0xc01edc78 0x00000001 0x00090000 0xc0103418 0x8000858e 0xc010341c 0xc01edc78 0xc0103428 0x8000863e 0x00000000 0xc01edc78 0xc010343c
03:48
<
f_ridge >
<clever___/D> ```(edited)
03:48
<
f_ridge >
<clever___/D> a CMD6 query, and the 512 byte reply
03:49
<
f_ridge >
<clever___/D> ah, printed beyond the end of the buffer, oops
03:49
<
f_ridge >
<clever___/D> ```
03:49
<
f_ridge >
<clever___/D> bool BCM2708SDHost::send_raw(uint32_t, uint32_t):135: CMD 6, arg=0xfffff0
03:49
<
f_ridge >
<clever___/D> bool BCM2708SDHost::wait_and_get_response():276: Cmd: 6 Resp: 00000900 0000066e ffffffff ffffffff
03:49
<
f_ridge >
<clever___/D> 0x01806400 0x01800180 0x01800180 0x00000380 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
03:50
<
f_ridge >
<clever___/D> ```(edited)
03:56
<
f_ridge >
<clever___/D> `0x00648001 0x80018001 0x80018001 0x80030000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 `
03:56
<
f_ridge >
<clever___/D> and with some byte swaps applies, it now makes sense
03:57
<
f_ridge >
<clever___/D> the card requires 100mA, and supports functions 0 and 15 in groups 2-6
03:57
<
f_ridge >
<clever___/D> in group 1, it supports functions 0/1/15, which is default and high speed
04:24
NightMonkey has quit [Ping timeout: 256 seconds]
04:24
<
f_ridge >
<clever___/D> and if i select high-speed mode, it asks for 200mA
04:38
NightMonkey has joined ##raspberrypi-internals
06:08
<
f_ridge >
<x2x6_/D> Hmm, you used argument 0xffffff0
06:09
<
f_ridge >
<x2x6_/D> in spec it said for check regime it should be bit 31 set as 0. And I thought everything else should be default
06:09
<
f_ridge >
<x2x6_/D> How did you guess to use all 0xffs?
06:09
<
f_ridge >
<x2x6_/D> And in which part of code you do that query?
06:13
<
f_ridge >
<x2x6_/D> I tried your argument. Definitely not enouh
06:13
<
f_ridge >
<x2x6_/D> I tried your argument. Definitely not enouhg(edited)
06:13
<
f_ridge >
<clever___/D> bit 31 being set, is a request to change the functions in each group
06:14
<
f_ridge >
<clever___/D> nibbles 0 thru 5 (bits 0-3, 4-7, ...) are function groups, each one can be set to a different function
06:14
<
f_ridge >
<clever___/D> so if you want to switch into high-speed mode, bits 0:3 must contain a `1`
06:14
<
f_ridge >
<clever___/D> putting an `f` in all of the others, is a request to not modified those groups
06:15
<
f_ridge >
<clever___/D> having bit 31 clear, is a query to see if the card supports that, and how many mA the card will draw
06:15
<
f_ridge >
<clever___/D> and bit 31 being set, is a request to actually change to that mode
06:15
<
f_ridge >
<x2x6_/D> That means you don't run in CMD6 in check mode to test if arguments will be supported?
06:16
<
f_ridge >
<clever___/D> i ran it with bit 31 clear at first, but function group 1 set to 0 (a typo really), and it returned 512 bits of status data
06:16
<
f_ridge >
<GitHub Lines/D> ```c
06:17
<
f_ridge >
<GitHub Lines/D> err = bcm2835_emmc_cmd6(CMD6_MODE_CHECK,
06:17
<
f_ridge >
<GitHub Lines/D> ```
06:17
<
f_ridge >
<x2x6_/D> any idea why id does not work in my case? My code see a bunch of errors in the interrupts as soon as cmd is written to emmc register and can not get response
06:18
<
f_ridge >
<clever___/D> ~3 things ive noticed for cmd6
06:18
<
f_ridge >
<x2x6_/D> I have just pushed to the tree, but there I just tried to override argument with your value - this does not work.
06:18
<
f_ridge >
<clever___/D> 1: it returns an R1 response (32bits of data)
06:18
<
f_ridge >
<clever___/D> 2: it returns 512 bits of data on the DAT pins (treat it like a 64 byte block read)
06:18
<
f_ridge >
<clever___/D> 3: the card must be selected (CMD7 i think it was?)
06:19
<
f_ridge >
<x2x6_/D> its all there
06:19
<
f_ridge >
<clever___/D> are you getting any response?
07:04
Lightsword has quit [Quit: ZNC]
07:04
Lightsword has joined ##raspberrypi-internals
07:43
<
f_ridge >
<clever___/D> ```c
07:43
<
f_ridge >
<clever___/D> bool sd_switch(int mode, int group, int value, uint32_t *resp) {
07:43
<
f_ridge >
<clever___/D> LTRACEF("(%d, %d, %d, %p)\n", mode, group, value, resp);
07:43
<
f_ridge >
<clever___/D> uint32_t arg = (!!mode) << 31 | 0xffffff;
07:43
<
f_ridge >
<clever___/D> arg &= ~(0xF << (group * 4));
07:43
<
f_ridge >
<clever___/D> arg |= (value & 0xF) << (group * 4);
07:44
<
f_ridge >
<clever___/D> *REG32(SH_HBCT) = 64;
07:44
<
f_ridge >
<clever___/D> *REG32(SH_HBLC) = 1;
07:44
<
f_ridge >
<clever___/D> send_raw(SD_SEND_SWITCH_FUNC | SH_CMD_READ_CMD_SET, arg);
07:44
<
f_ridge >
<clever___/D> if (wait_and_get_response()) {
07:44
<
f_ridge >
<clever___/D> return read_data(resp, 64);
07:44
<
f_ridge >
<clever___/D> } else {
07:44
<
f_ridge >
<clever___/D> logf("CMD6 fail\n");
07:44
<
f_ridge >
<clever___/D> return false;
07:44
<
f_ridge >
<clever___/D> }
07:44
<
f_ridge >
<clever___/D> }
07:44
<
f_ridge >
<clever___/D> uint32_t switch_reply[64/4];
07:44
<
f_ridge >
<clever___/D> sd_switch(0, 0, 0, switch_reply);
07:44
<
f_ridge >
<clever___/D> for (unsigned int i=0; i<(64/4); i++) {
07:44
<
f_ridge >
<clever___/D> printf("0x%08x ", htonl(switch_reply[i]));
07:44
<
f_ridge >
<clever___/D> }
07:45
<
f_ridge >
<clever___/D> puts("");
07:45
<
f_ridge >
<clever___/D> sd_switch(1, 0, 1, switch_reply);
07:45
<
f_ridge >
<clever___/D> for (unsigned int i=0; i<(64/4); i++) {
07:45
<
f_ridge >
<clever___/D> printf("0x%08x ", htonl(switch_reply[i]));
07:45
<
f_ridge >
<clever___/D> }
07:45
<
f_ridge >
<clever___/D> puts("");
07:45
<
f_ridge >
<clever___/D> ```
07:45
<
f_ridge >
<clever___/D> this will first query things, then switch them
07:45
<
f_ridge >
<clever___/D> but its not entirely according to spec, its asking for the support of one thing, then using something else entirely
07:45
<
f_ridge >
<clever___/D> and you should ideally check the reply, and see what it supports
07:45
<
f_ridge >
<clever___/D> i'm heading off to bed
11:05
Herc has quit [Read error: Connection reset by peer]
11:06
HerculeP has joined ##raspberrypi-internals
11:30
Roy_Mustang has joined ##raspberrypi-internals
11:30
Lightsword_ has joined ##raspberrypi-internals
11:31
srk- has joined ##raspberrypi-internals
11:32
t0mm13b_ has joined ##raspberrypi-internals
11:36
Lightsword has quit [*.net *.split]
11:36
srk has quit [*.net *.split]
11:36
t0mm13b has quit [*.net *.split]
11:36
A_Dragon has quit [*.net *.split]
11:36
NeddySeagoon has quit [*.net *.split]
11:36
mithro has quit [*.net *.split]
11:36
gruetzkopf has quit [*.net *.split]
11:36
Lightsword_ is now known as Lightsword
11:36
srk- is now known as srk
11:44
gruetzkopf has joined ##raspberrypi-internals
11:44
NeddySeagoon has joined ##raspberrypi-internals
11:44
mithro has joined ##raspberrypi-internals
11:48
Roy_Mustang is now known as A_Dragon
11:52
jcea has joined ##raspberrypi-internals
12:15
NeddySeagoon has quit [*.net *.split]
12:15
mithro has quit [*.net *.split]
12:15
gruetzkopf has quit [*.net *.split]
12:17
mithro has joined ##raspberrypi-internals
12:17
NeddySeagoon has joined ##raspberrypi-internals
12:17
gruetzkopf has joined ##raspberrypi-internals
12:24
Stromeko has quit [Quit: Going… gone.]
12:26
Stromeko has joined ##raspberrypi-internals
16:04
dolphinana has joined ##raspberrypi-internals
20:40
juri_ has quit [Ping timeout: 252 seconds]
20:41
juri_ has joined ##raspberrypi-internals
21:18
clever has quit [Ping timeout: 240 seconds]
21:24
clever has joined ##raspberrypi-internals
22:42
dolphinana has quit [Quit: Leaving]