leowt changed the topic of #linux-rockchip to: Rockchip development discussion | http://linux-rockchip.info | http://irclog.whitequark.org/linux-rockchip
tonikasch has quit [Quit: lalalalalalalalalall]
vinifr has quit [Quit: Saindo]
hipboi has joined #linux-rockchip
akaizen has quit [Remote host closed the connection]
Topgun100 has quit [Quit: Topgun100]
Legitsu has joined #linux-rockchip
Astralix1 has joined #linux-rockchip
Astralix has quit [Ping timeout: 264 seconds]
Topgun100 has joined #linux-rockchip
Legitsu has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Topgun100 has quit [Quit: Topgun100]
Topgun100 has joined #linux-rockchip
akaizen has joined #linux-rockchip
Topgun100 has quit [Quit: Topgun100]
AstralixNB has joined #linux-rockchip
Topgun100 has joined #linux-rockchip
rellla has joined #linux-rockchip
Topgun100 has quit [Quit: Topgun100]
rellla has quit [Quit: Nettalk6 - www.ntalk.de]
mmind00 has joined #linux-rockchip
kostas_ has joined #linux-rockchip
kostas_ has quit [Client Quit]
massi has joined #linux-rockchip
akaizen has quit [Remote host closed the connection]
rellla has joined #linux-rockchip
Theueip has joined #linux-rockchip
tonikasch has joined #linux-rockchip
vinifr has joined #linux-rockchip
leowt has joined #linux-rockchip
atiti has joined #linux-rockchip
<hramrach> indeed
<hramrach> it freqency scaling already supported on rk chips?
<arokux> guys, it was announced here weeks ago
<hramrach> or anyone managed to run a memmory benchmark with the original kernel on some device?
<arokux> correct me if I'm wrong. from what I read allwinner has got community attention whereas rockchip has better SoCs..
<hramrach> not really sure about that
<hramrach> rk has more cores on their chips and better manufacturing process so even with that many cores there is some chance the chips won't melt
<hramrach> but if you don't get proportionally faster memory compared to AW the cores are pretty much useless
<hramrach> also there is some community interest in rk hardware
<hramrach> but there are fewer developers and focus is on mainline drivers rather than some hack that works right now so the progress is way slower
<arokux> hramrach, but compared to sunxi it is very very small
<hramrach> the focus on mainline is understandable. there is really no way to make workable kernel with the old unix way of configuration - adjusting C source
<hramrach> well, the problem is the device is 'opensource' but there is no really working source for it afaik
<hramrach> that can be probably fixed to some extent but not sure what real world performance you will get on the chip and so not sure if worth the effort in looking into that
<arokux> hramrach, which device is 'opensource'?
vinifr has quit [Quit: Saindo]
<hramrach> also real world applications rely on video decoding and I doubt there are opensource libraries for *that*
<hramrach> rk3066/3188/whatever
<hramrach> there are Linux sources with crappy drivers and some drivers are integrated in upstream linux kernel but there is not full support
<hramrach> over time you could probebly get linux mainline support on par with the manufacturer source drops with the benefit that you can use the same kernel on any device
<arokux> hramrach, well there is no u-boot support yet
<hramrach> you can just use whatever is pre-installed so long as it works
<hramrach> if it requires too much kernel hacking to load from that it's somewhat impractical, sure
<hramrach> also AW has better bootloader and overall the chip more developer friendly
<hramrach> I mean the on-chip bootloader
tinti has joined #linux-rockchip
<arokux> hramrach, yes, would be nice to see the community grows around rockchip too.
<hramrach> I guess you would get way better chip if you picked the advantages from both rk and aw but that's not gonna happen
<hramrach> also practical use ..
<hramrach> I wanted to use an aw soc based board as desktop replacement but if it cannot play video that's not gonna work
<hramrach> and it turns out that the drivers for the media accelerator are full of bugs
<arokux> hramrach, desktop?? it is way to slow for a desktop pc
<hramrach> and that the latest fad is 10bit avc which the hardware probably cannot decode anyway
<arokux> hramrach, what is "10bit av"?
<arokux> avc*
<hramrach> yes, the memory bandwidth also sucks. you cannot attach a 1080p screen without getting picture artifacts
<hramrach> a h264 encoding option which is reportedly an 'extension' of the avc standard
<arokux> hramrach, for desktop arm you could take a look at one on these: http://utilite-computer.com/web/utilite-models
<arokux> hramrach, my dream is to have mainline linux with support enough to connect an external HDD and use the board as wifi router. nas+wifi router basically.
<hramrach> why those?
<hramrach> does the imx have more power than AW or RK?
<arokux> hramrach, no idea. they just looked nice :)
<hramrach> they use the same base core and unspecified interconnect and memory controller, just like rk
<hramrach> also what is their media decoding support?
<arokux> hramrach, I really do not know, but you can check it out here: http://utilite-computer.com/web/utilite-pro-specifications
<hramrach> well, they claim 1GHz ddr3
<hramrach> if that translates to 500MHz clock then the clock is somewhat higher than what AW can achieve
<mmind00> arokux: this shouldn't be to hard ... at least for the rk3066 ... depending on where you want to connect it to, it's either a standard ehci controller or a synopsis dwc2 [the otg with a driver in staging]
<hramrach> what is real world performance depends on the efficiency of the memory controller which is big unknown
<arokux> hramrach, check out pro model it has 2GB DDR3-1066
<arokux> mmind00, yes.. i'm struggling to add usb host to A10 in mainline, no success so far, works only partially, but i'm a noob.
<arokux> hramrach, anyway, i'm not advertising these devices here. I found them interesting because they have 2xLAN - needed for a router in my case, because I'd like to have wired connection with desktop.
<hramrach> theoretical bandwidth of the AW memory is way higher than what is required for 1080p scanout but practically you get issuess
<hramrach> arokux: yse same as the 'standard' model
<hramrach> you can add USB ethernet to any device.
<hramrach> the onboard ethernet may be more efficient than that but then again it may not
<arokux> hramrach, yes you can, but this is not "nice" :)
<hramrach> it's nice enough for me. especially when it does the same job for third the price
<hramrach> the cheap AW boards are well capable as low-bandwidth router
<arokux> hramrach, the price could be lower if second ethernet were integrated onto one of the AW boards, or?
<hramrach> you can get an AW board and an USB ethernet just fine
<hramrach> the utilite schematic claims PCIe connected gigabit ethernet so it can really be quite efficent
<arokux> hramrach, that is correct. I just wonder why there isn't a router+cloud-storage--centric board
<hramrach> but without GBit data source or fast large storage you have nothing to feed it, anyway
<hramrach> and you don't get SATA or USB3 on those
atiti has quit [Ping timeout: 264 seconds]
<hramrach> the reason is that the interconnect and/or memory bandwidth is probably not enough to get you a full GBit throught the board
<hramrach> like from storage to ethernet or from one ethernet to another. it's not zero copy, every byt is buffered at least once and new headers slapped on
<arokux> I see
<hramrach> also you don't have enough fast external interfaces
<arokux> hramrach, why do you think there there is no arm board which can be a router and nas?
<hramrach> you need one with 2xethernet and decent SATA
<hramrach> or 3xPCI(e)
<hramrach> or some combiantion
<hramrach> maybe some top of the line Exynos could now
<hramrach> not sure what the Exynos 5 sata is.
<hramrach> the AW has sata with is 1-port no PMP :/
<arokux> hramrach, well, not necessarily. it shouldn't be sooo fast. just 2xLAN, usb and wifi access point
<hramrach> you don't wan USB nas. that's not about being fast. it's about not being abysmally slow
<arokux> hramrach, :) the point is i can connect an external drive through usb, if needed i can take the drive with me.
<arokux> hramrach, I do not want an hdd which can only sit on top of the arm board
<arokux> hramrach, i haven't seen external hdd drives with sata..
<hramrach> well, Exynos 5 has USB3 which makes USB storage somewhat viable
<hramrach> there are some eSATA drives for sure
<arokux> hramrach, but the connection on the aw boards are SATA
<hramrach> that's just different connector
<hramrach> not sure if the boards support hotplug, though
<arokux> hramrach, and: every device is usb capable, so I can connect it to any tablet etc
<hramrach> yes, for mobile storage sata is not that great
<arokux> hramrach, those were my considerations. sacrificing speed for generality, if one can say so
<hramrach> then any bord will do, even the cheapest A13 I guess
<arokux> hramrach, wifi in access point mode could be a problem I haven't get to this point yet, as wlan adapter is connected though usb
<arokux> hramrach, i'm struggling to add usb host support to mainline sunxi now
<hramrach> wifi in AP mode is a metter of picking a correct wifi card
<arokux> hramrach, again external?
<hramrach> but last time I tried the ones supported were ususall ones you could not buy anymore.
<hramrach> why not? most of the time you want external antenna anyway
<hramrach> yes, boards with mini-pci slots are better for APs
<hramrach> but none of aw/rk/imx has that
<arokux> hramrach, because there is already a wlan adapter in Mele set-top boxes. I've seen people has managed to make them work as APs
<hramrach> imx could have mini-pcie but you would need a differnt board that actually includes that connector
<arokux> hramrach, cubietruck will have wifi too, do not know if it supports AP mode
<hramrach> and don't think that on-board USB or SDIO wifi is better than external
<hramrach> well, if it has good enough antenna for your purposes out of hte box your win
<hramrach> it it has not you will need an external wifi or antenna mod anyway
<hramrach> some RK HDMI sticks (and probably AW too) have wifi as well
<hramrach> but no ethernet
<hramrach> and olinuxino boards have wifi option
<arokux> hramrach, no, I do not think internal ones are better, I just want to buy one board without a pile of additional components. wifi is going to be used for some slow things, main connection should go through cable to my desktop.
Theueip_ has joined #linux-rockchip
leowt has quit [Quit: leowt]
Theueip has quit [Ping timeout: 276 seconds]
<hramrach> arokux: yes cubietruck will have one ethernet. if you want two the imx board is one of the few that has them besides routherboards and the like
<hramrach> there was once guruplug which had two ethernets (not sure about wifi) but using both caused overheating to the board
<arokux> hramrach, I've noticed that arm SoCs are not used for network storage, why is that so?
<AstralixNB> missing SATA and USB3.0
<arokux> Astralix1, but Allwinner chips support SATA
<AstralixNB> but only one, I guess
<hramrach> yes, 1 port no PMP
<AstralixNB> you see
<hramrach> also until a20 no gbit ethernet
<AstralixNB> so for a really cool transcoding and fast media server either this or that is missing
<hramrach> well, Exynos 5 has SATA *and* USB3, tegra and imx6 has PCIe
<arokux> I see, why they won't close this gap?
arokux has left #linux-rockchip ["Leaving"]
<hramrach> so you can expect NAS based on those coming in near future
arokux has joined #linux-rockchip
<AstralixNB> yes, I bet we'll see some more NAS related options in the next generation of these chips
<AstralixNB> not only SATA and / or USB3.0 but ECC hardware too for RAID
<hramrach> well, for media transcoding they would have to make a media codec with actual working drivers (near impossible) or docs (near impossible)
<arokux> the network storage boxes are based on Realtek 8196C
<arokux> (some that I've seen)
<arokux> I cannot find any doc on Realtek 8196C, what kind of chip is it?
<hramrach> you could possibly get ECC in software on 4-core box and there are PCI accel boards too
<hramrach> if it's from Realtek it's cheap junk but it gets something you can present a sworking solution
<AstralixNB> 8129 is a WIFI chip
<hramrach> most likely
<AstralixNB> IEEE 802.11n, 2.4GHz, 2T2R, MAC/BB/RF PCI-Express Single-Chip WLAN
<arokux> this cheap junk has usb 3.0 ;)
<arokux> and wlan in AP mode
<AstralixNB> its better than most modules in china tablets as these only support 1T1R
<AstralixNB> but even if the chipset supports 2T2R you're never sure if they solder two antennas
<arokux> so I am just curios why arm SoCs do not offer decent storage connectivity ...
<AstralixNB> different targt markett
<hramrach> because tablts and TV sticks don't need
<AstralixNB> you don't want to have SATA in your tablet
<hramrach> I do ;-)
<arokux> I thought with IPs that can be easily integrated one can build every possible SoC
<hramrach> but each SoC has to be debugged
<AstralixNB> and you have to pay the license fees for using the ips and the interfaces and the logos
<AstralixNB> have to leave now, be back later on my other account
<hramrach> and it costs silicone space which is very limited for the cheap low density manufacturing processes
<arokux> I mean ARM technology seems so general to me that any kind of SoC/board can be created. that is why I cannot understand why contemporary SoCs are so focused only on phones/tablets
<hramrach> because phones/tablets are big market and you cannot sell a NAS solution based on SoC that is not powerful enough - or at least not either more powerful or cheaper than the realtek chipset
<hramrach> try to estimate how many of your friends have a tablet or phone and how many have a nas :P
<hramrach> and how many have 3 phones and 2 tablets ;-)
<arokux> hramrach, true...
<arokux> so because the market is much smaller designing of connectivity IP cores won't pay off?
leowt has joined #linux-rockchip
<hramrach> it will when they have some features to offer or you can use one of of the off-the-shelf cores as NAS with some extra support chips and offer more features than the cheapest-possible NAS chipsets do
mmind00 has left #linux-rockchip ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
mmind00 has joined #linux-rockchip
<arokux> A10 costs $7 not cheap enough to compete with Realtek chips?
<hramrach> which is probably right now but will take some time to take off
<arokux> hramrach, what do you mean by "to take it off"?
<hramrach> to take off - like start or w/e
<zoobab_> hi
akaizen has joined #linux-rockchip
<arokux> hramrach, well, ARM SoCs can run full blown distro, what could be better? the only thing is the price then, other things equal it is the price of the SoC that makes difference
<hramrach> anyway, I am not sure what the realtek chipset costs and what features it offers but the A10 is not very good as NAS and has extra sillicone that will not get usd in the NAS so it will likely come out worse
<arokux> but the price of the ARM SoCs is $7 USD, which is negligible(?)
<tonikasch> hi zoobab_
<hramrach> the realtek chip can run full distro as well but has no video presumably
naobsd has joined #linux-rockchip
<hramrach> so even if the price is $1 lower the manufacturere still gets more from using cheaper chip with lessunused features
<hramrach> also the realtek router has 64mb ram which hints at simpler and cheaper ram controller
<arokux> hramrach, what are those realtek chips, which arch do the implement?
<hramrach> they run openwrt so look in their docs
<zoobab_> are there any good devboard based on RK3066?
<arokux> hramrach, seems to be MIPS
<hramrach> zoobab_: unlikely. but there are boards with rk3188 under development
tinti has quit [Read error: No route to host]
tinti has joined #linux-rockchip
<hramrach> 3066 is old so you are not likely getting any new design with that and no widely available devboard is known afaik
<arokux> hramrach, you see, if those realtek chips are so cheap it follows for me that adding their features to ARM SoCs should be cheap too :)
<zoobab_> I imagine
<zoobab_> ah posted 2 days ago
<arokux> hramrach, or my logic is fals..
<arokux> false*
<hramrach> arokux: they are cheap because they are underpowered and are missing much of the features the SoCs targeted at tablets have
atiti has joined #linux-rockchip
rellla has quit [Quit: Nettalk6 - www.ntalk.de]
<arokux> hramrach, I mean adding this small set of features to ARM SoCs shouldn't be difficult and shouldn't make them more expensive..?
<hramrach> also note that the realtek router claims only 100Mbit NIC which you can easily get with USB
<hramrach> it will make them more expensive for sure and will make them non-competitive against both other tablet SoCs and other NAS SoCs. it's not necessarily an advantage that a SoC can do more
<arokux> hramrach, ok, I see
<arokux> hramrach, the last question that remains for me is why there is no (or very little) underpowered ARM SoCs with limited features so that they could compete with Realtek style chips.
<arokux> hramrach, for some reason all those realtek, atheros, broadcom are MIPS, why?
<hramrach> arokux: there are underpowered ARM chips
<hramrach> some of them cannot run Linux, however. they lack MMU or something
<hramrach> also they might be targetting different embedded applications which are not so attractive for hackers
<arokux> hramrach, my question is why almost certainly MIPS for routers
<hramrach> if you look at the openwrt docs you will see it runs also on arm
<arokux> hramrach, well it is difficult to find a router on arm
<hramrach> but there might be no reson at all. just somebody made a mips chip for routers and everyone wanted to leverage existing code so they also based on mips
<hramrach> or it might be that the mips cores have features that fit the use case or had some time ago
<hramrach> another reason might be licensing. it's probably different for mips and if you don't need the extra features ARM can provide MIPS maybe more cost effective
<hramrach> and that's one area where you can't really know
<arokux> hramrach, I see
<arokux> thanks a lot for the answers
AstralixNB has quit [Ping timeout: 264 seconds]
<arokux> hramrach, I've found this article to be interesting, maybe i'll be interesting for you too: http://www.dailytech.com/MIPS+Looks+to+Challenge+ARM+in+Mobile+Device+Dominance/article24700.htm
mmind00 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
massi has quit [Quit: Sto andando via]
<arokux> ok, so ARM-based routers are coming
leowt has quit [Quit: leowt]
GeorgeJ has joined #linux-rockchip
<hramrach> you see, it's just a matter of somebody finding hte right market for the core
<Astralix1> Anyone here having some knowledge in USB protocols?
<Astralix1> I have a little trouble with the command sequences of the rkflashtool
Topgun100 has joined #linux-rockchip
tinti has quit [Ping timeout: 245 seconds]
<hramrach> heh, I could use some USB protocol knowledge
tinti has joined #linux-rockchip
<hramrach> I have more than one device that does not just work out of the box and WorksWithWindows(tm)
<Astralix1> It is not directly USB but a little part of it
<Astralix1> the Mass Storage Device has a CBW a Control Block Word.
<Astralix1> The rkflashtool uses this CBW to send commands to the bootloader on the device
<Astralix1> as it is part of the mass storage protocol, commands may be executed in an optimized way by the device.
<Astralix1> So replies to commands may come back to the host in a different follow up as they where sent to the device.
<Astralix1> Everything clear until here?
<Astralix1> So for the host to find out to which request an aswer is, the host generates a CBW Tag, a uint32_t number plate to pin to the command.
<Astralix1> the device attaches the same number plate in it's answer so the host can find out which status was to what command it sent before.
<Astralix1> in the rkflashtools where several bugs.
<Astralix1> One of it was to handle the CBW Tag ( it is called cid in the code) as an uint8_t.
<Astralix1> Second, any original rk windows tool (batchtool, rkandroidtool) uses the same sequence of cids (or CBW Tags).
<Astralix1> As I traced lots of USB communication, it seems, that some answers from the device to the host are only correct, if the matching cid is used.
<Astralix1> So the initial sequenc is this:
<Astralix1> 0xCF319000;
<Astralix1> 0xE5597A95;
<Astralix1> 0x034D83B5;
<Astralix1> 0xDB2CBFD2;
<Astralix1> 0x2A255D17;
<Astralix1> 0x011E72FD;
<Astralix1> Any idea how they calculate this?
<hramrach> heh, maybe it's just magic constant?
<Astralix1> no, it is changing with every command issued
<Astralix1> I guess it is somehow calculated
<Astralix1> and has a fixed start value
<hramrach> and are you sure it's supposed to be exactly that ?
<Astralix1> Yes
<hramrach> maybe only the start is fixed
<Astralix1> Why?
<Astralix1> 0040 55 53 42 43 cf 31 90 00 00 00 00 00 80 00 06 00 USBC.1.. ........
<Astralix1> is the same on rk3188, rk3066 and rk2918
<Astralix1> is the same on rkandroidtool.exe and batchtool.exe
<hramrach> like if you transfer a kernel it's 3MB of data or so and all of that has pre-defined tags?
<Astralix1> and if I use a different token, the answer from the bootloader is different
<Astralix1> no
<Astralix1> writing data works, most times
<hramrach> ok
<Astralix1> but getting some data from the device doesn work
<Astralix1> The background is like this:
<hramrach> are the commands sent by each tools the same?
<Astralix1> Not all of them, but moste
<hramrach> maybe the tag is related to the request sent
<Astralix1> the intention behind is, that the original software requests some data from the device
<hramrach> like a crc or something
<Astralix1> If it is a crc, it should result in failing write operations
<Astralix1> but write works
<Astralix1> The thing is that newer chips reply with a string that looks like giving some info about the system.
<Astralix1> The older devices need to be polled with the same command until a bit flips. Then you know that the message is over
<Astralix1> But the content of the message changes with the CID.
<hramrach> crc for writes would not work for zero blocks
<hramrach> but for commands it's differnt story
<Astralix1> But writing blocks has same command with changing CID
<hramrach> if you get the tag right
<Astralix1> And requesting bootloader information has same command but needs different CIDs
<Astralix1> look, it is like this
<Astralix1> First we call bootloader and say hello:
<Astralix1> USBC CF 31 90 00 00 00 00 00 80 00 05 00 FD 00 00 00 ...
<Astralix1> Device answers:
<Astralix1> USBS CF 31 90 00 08 00 00 00 01
<Astralix1> so 08 tells that there is more to come
<Astralix1> Now we call again with a new command:
<Astralix1> USBC CF 31 90 04 00 00 00 00 80 00 05 00 00 00 00 00 ...
<Astralix1> And the device answers:
<Astralix1> USBS CF 31 90 04 08 00 00 00 01
<Astralix1> And that is wrong
<Astralix1> in the original transfer
<Astralix1> OUT USBC E5 59 7A 95 00 00 00 00 80 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<Astralix1> IN USBS E5 59 7A 95 08 00 01 2C 01
<Astralix1> it goes like this. The device returns 2C as the first parameter
<Astralix1> Then the host changes the CID and requests again the same command but gets a different answer:
<Astralix1> OUT USBC DB 2C BF D2 00 00 00 00 80 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<Astralix1> IN USBS DB 2C BF D2 08 00 02 4D 01
<Astralix1> so there is a counter and the value 4D
<hramrach> what happens if you call 0xDB2CBFD2 after 0xCF319000
<Astralix1> I just made ma a small table and try that
<Astralix1> just give me a second
<naobsd> I think that command is waiting device to be ready
<hramrach> there are too many commands for just that :s
<naobsd> I think CID has no information
<hramrach> it should not have but apparently different reply is obtained with different cid :/
<naobsd> # of hello may vary, there is no relation between CID value and command
<naobsd> same seed is given, same number is used, but it's just sequence number
<naobsd> ah, same seed is given, same CID is calculated
<hramrach> maybe the missing bit is waiting long enough
<hramrach> but also the command is 00 00 00 00 80 00 05 vs 00 00 00 00 80 00 06
<hramrach> so maybe just typo?
<hramrach> no, it actually looks correct
<Astralix1> According USb Mass Storage Protocol this is just a unique number plate for a command packet
<hramrach> 00 00 00 00 80 00 05 always returns 08 00 00 00 01 and
<hramrach> 00 00 00 00 80 00 06 returns something that varies somewhat
<Astralix1> packets are traced with a commercial tracer and wireshark. Same results and they are traced of the original RK windows software
<naobsd> I don't think there is no reason to follow UMS protocol strictly, but I think CID is just a unique number
<hramrach> how long is the CID?
<hramrach> looks like 2 bytes from the trace
<Astralix1> look here....
<naobsd> RK guys uses some kind of (weak) RNG, I guess
<hramrach> actually more like 4
<Astralix1> it si 4 bytes
<Astralix1> Here is a different doc telling mostly the same
<naobsd> my original code treat CID as 4 bytes, 1byte CID is regression by rkflashtool ;)
<naobsd> anyway cid++ is working from RK28 age
<Astralix1> And here is the original doc, that should contain the truth :)
<Astralix1> Ok so how do we then explain the behavior?
<Astralix1> same command different CID giving different response
<hramrach> it replies depending on the command and state
<naobsd> Astralix1: btw, did you read my message? http://irclog.whitequark.org/linux-rockchip/2013-09-04
<hramrach> 00 00 00 00 80 00 06 reads something that is not always the same perhaps?
<Astralix1> reply is the same anytime the sequence is called
<Astralix1> second the reply contains an ordered element
<Astralix1> and a repeating element
<naobsd> Astralix1: "different response" means non-CID part in response is different?
<Astralix1> yes
<Astralix1> but with same cid same response
<naobsd> which command?
<Astralix1> 00 00 06 00
<Astralix1> the 'hello bootloader'
<hramrach> it's called twice in the log
<Astralix1> yes
<naobsd> it should "wait device ready"
<Astralix1> different behaviour in rk3xxx and rk2xxx
<naobsd> and it may be once, or twice, or more
<Astralix1> in rk3xxx it replies 00 00 06 00
<hramrach> until 'ready' respose
<naobsd> different behaviour on same SoC, same device
<naobsd> until ready, yes
<Astralix1> in rk2xxx it replies 08 00 00 01
<hramrach> that 01 response is to 05 command, at least in the log
<Astralix1> The init sequence of Rk3xxx and RK2xxx is lot different:
<hramrach> which is same as first time so not mysterious
<naobsd> replies "00 xx xx 00" when it's ready
<Astralix1> RK3xxx
<Astralix1> OUT USBC CF 31 90 00 00 00 00 00 80 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<Astralix1> IN USBS CF 31 90 00 00 00 00 06 00
<Astralix1> second
<Astralix1> OUT USBC E5 59 7A 95 00 00 00 00 80 00 06 1B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<Astralix1> IN [42 30 31 33 32 31 30 32 30 33 31 31 30 30 31 56] B01321020311001V
<Astralix1> IN USBS E5 59 7A 95 00 00 00 00 00
<naobsd> B013... is CPU id
<Astralix1> cool, wht is the rest
<naobsd> as I explained at 2013-09-04
<Astralix1> there must be a hint to the write sector sizes and erase sizes of the nand
<naobsd> yes of course
<Astralix1> I missed that explanation, as I had to leave and
<Astralix1> didn't scroll back in the log
<Astralix1> so that is my fault
<hramrach> it't logged on the web too
<naobsd> there is 2bytes, I guessed 1 is block size, 1 is number of blocks
<naobsd> 0x00061a00 returns nand info
<Astralix1> second, I note that down
<naobsd> 0x00061a00 returns 512bytes
<Astralix1> I have 05 1a
<naobsd> offset 0x5 or 0x6 or 0x26 or 0x2d should be block size, and 0x36 should be number of blocks
<naobsd> well
<Astralix1> the protocol is no problem itself
<Astralix1> I rewrote some parts of the rkflashtool to use some functions
<Astralix1> and instead of defines I prepared a structure for the command using attribute packed
<Astralix1> it is just how to figure out the optimized flash handling
<naobsd> sorry, I can't find 05 1a in my usb dump
<Astralix1> Get Partition Table or Defects Table?
<Astralix1> OUT USBC DB 2C BF D2 00 00 00 00 80 00 05 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
<Astralix1> IN [BULK 512 bytes]
<Astralix1> IN USBS DB 2C BF D2 00 00 00 00 00
<Astralix1> It is in RK3188 trace
<Astralix1> erase IDB
<Astralix1> The IDB handling is still a bit mysterious
<naobsd> hmmm, erase IDB is 0a 06 in my dump
<Astralix1> I can load the excerpts I made in a txt file somwhere
<Astralix1> wait a second
<naobsd> and it does not return 512B :(
<Astralix1> ISB handling is 2112 and 8448 bytes per sector
<Astralix1> IDB
<Astralix1> now we can talk about the same thing
<naobsd> ah
<naobsd> strange, there are two 06 1a in my dirty code(used as a note) ;)
<naobsd> one of them must be 05 1a
<Astralix1> The thing is, that I had to copy the traces out by hand as usblyzer crashes if I copy'n'paste out of the VM.
<naobsd> oops, no, two 06 1a are correct...no 05 1a in my dump :(
<naobsd> it shoud 06 1a, 512B is nand info
<Astralix1> this 05 1a is one step before erase IDB and the trace is made with RK's batchtool
<naobsd> 0a 03 is reading bad block info
<Astralix1> I can check if I can see it again in the RkAndroidTool on the RK2918
<Astralix1> Yes, looks like
<naobsd> see offset 0x36 of 05(06) 1a response
<naobsd> it's num of blocks
<naobsd> 0a 03 returns 64B
<Astralix1> I can see 0a 03 returning 64 bytes of data, but ddid not save the data itself for inspection
<naobsd> it's not MSC protocol, I guess
<Astralix1> The command framing is the same, but the commands used are not in the spec
<naobsd> it should not assume it's MSC
<naobsd> anyway, 0a 03 should be issued some times, depend on num of blocks
<Astralix1> I have seen devices, having a bootloader integrated as a virtual MSC
<Astralix1> you copy over the firmware.bin file to this virtual harddrive and your firmware update is done
<Astralix1> But I guess the big secret is the flash driver, the rknand_ko.ko thing
<Astralix1> They read the bad block information from the NAND, and read the current Inode Database.
<naobsd> you saw RK device which act as MSC?
<Astralix1> Never, it was a different SOC
<Astralix1> like Olympus HD Camera
<Astralix1> or Fuji HD Cam?
<naobsd> I see. RK should not be same
<Astralix1> something like that
<Astralix1> They calculate a new
<Astralix1> sector layout around the defects table
<Astralix1> and then write this new IDB precalculated down to the device
<Astralix1> I wonder if we can do a firmware download at all in a safe way
<Astralix1> because we cannot recalculate the new sector layout and we cannot swap to a new sector if one fails caus we cannot mark it as bad
<Astralix1> The reason will be:
<Astralix1> I flashed a large thing like system.img of 400MB to my tablet and it fails to work
<Astralix1> Lars had the same problem and checked, it as different content in one sector
<Astralix1> reflashing just gives same defects
<Astralix1> I flashed with rkandroidtool and check failed in the tool
<Astralix1> i did erase IDB and reflashed everything and it worked fine.
<naobsd> there is some unknown things
<naobsd> there are
<naobsd> extra 2 bytes are added to ddr and usb boot code via control transfer in maskrom mode
<naobsd> there are OOB(ECC) bytes to write data into IDB
<naobsd> but no idea how to calculate it
<naobsd> there is CRC block, no idea how to calc too
<hramrach> can you boot without nand containing anything sane?
<naobsd> disassembling RK*Tool.exe may be necessary...
<naobsd> well
<hramrach> guess not atm
<naobsd> you = with rkflashtool? no
<hramrach> although it should be possible, technically
<hramrach> with any tool
<naobsd> with official RK tool? yes
<hramrach> but they od that by writing something sane in the flash, right?
<naobsd> well
<hramrach> anyway, it's probably not all that useful
<hramrach> was wondering if changing the flash format would be useful
<naobsd> RK tool can push some code which can do same thing as bootloader flashed on NAND
<Astralix1> Ok, I do kn9ow how to fire up disassembler and I read ARM assembler and doeznds other MCUs too
<hramrach> but there is no bootloader whatsoever other than the binary one for the current format
<Astralix1> But I stopped Intel architecture at end of 386
<Astralix1> I already disassembled the mask rom loader and the version 1.18 bootloader
<Astralix1> but it is somewhat optimized. Far mor compact than kernel code is.
<Astralix1> and there where not enough handles to jump in. But I only took a look at it for some few hours
<hramrach> also changing flash format would be only viable if there is known way to access the raw blocks
<hramrach> which there probably isn't
<Astralix1> Hmm... that is done by any current NAND driver having FTL techniques
<naobsd> only DDR, USB OTG, NAND should be cared in bootloader (in addition to core functions)
<Astralix1> The bootloader itself must reside in the appropriate section of the flash
<hramrach> hmm
<hramrach> disassembling rk_nand.ko might be more useful for flash access
<hramrach> but maybe not if there is much more code
<naobsd> for linux kernel, that section is hidden, outside of mtdX nodes
<Astralix1> So here is a datasheets from one of the RK3188 devices of me
<Astralix1> Page Size is 16k + 1280 Spare bytes
<naobsd> it's also hidden for 0a 14 and 0a 15 bootloader command which is usually used to read/write firmware images
<Astralix1> Let me check a thing... I need to find the datasheet of the RK3188 device I used in my trace
<naobsd> data for spare(OOB) area need to be given for 0a 05 command
<Astralix1> Too bad but it is hidden below a cooling plate
<naobsd> no idea how to calc it...
<Astralix1> could be they use their famous RKcrc
<Astralix1> but normally you do not save an crc but an ECC that allowes to restore some defects
<Astralix1> Ah!
<Astralix1> did you open the above liked document?
<Astralix1> linked
<Astralix1> Go to chapter 1.11 Bad Block Management
<Astralix1> You have to read out the spare area and detect marked bad blocks. Thenm you may erase blocks and then you need to write back the information
<naobsd> u-boot should have this(or similar) code
<Astralix1> Afaik, RK already uses a modified uboot
<naobsd> ah, well coded bootloader which handles flash memory should have similar code ;)
<naobsd> I have no info about u-boot for RK
<naobsd> sorry, too sleepy
<Astralix1> no problem
<Astralix1> just cleaning up code and then go to bed too
Topgun100 has quit [Quit: Topgun100]
Topgun100 has joined #linux-rockchip
Topgun100 has quit [Quit: Topgun100]
Topgun100 has joined #linux-rockchip
tinti_ has joined #linux-rockchip
tinti has quit [Ping timeout: 248 seconds]
GeorgeJ has quit [Remote host closed the connection]
vinifr has joined #linux-rockchip