[U-Boot] Basic A33 support including dram init available in my personal repo

Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Basic A33 support including dram init available in my personal repo https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Regards, Vishnu Patekar

Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
Ah, that is both good and bad...
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
I've been working on A33 dram support too, without any source code access, instead I've been tracing what the boot0 machine code does and going from there. What I've sofar is that the code first inits the DRAM PLL / cmu dram registers, it seems that the A33 has 2 dram pll-s and that one of the dram_para fields configures which pll to use and configures some sigma-delta pattern to reduce rf interference, at least on my A33 tablet the code seems to want to pick the new / second dram pll. But I see no reason why the first one should not work, so for now if I were you I would just use the A23 dram pll / cmu setup code modified to set the one or 2 extra reset / enable bits the A33 has, but still using the old / first dram pll, we can always add support for the new one later.
Then the boot0 code calculates a load of timing parameters and writes these to registers. I've already written my own C-code reproducing the init algorithm from boot0 for this (attached) this is GPL code and you should be able to use this to replace a chunk of the bsp code. Note that I found 2 code paths based on a tpr13 bit (iirc) one for autoconfig, and one for reading values from the tpr dram_para values, my code supports only autoconfig, you can add a printf to warn if manual config is requested and still keep using autoconfig. The same goes for any other code paths were there is both a manual and an auto option, look at what actual shipped tablets are using, only support that and print a warning for the other case, were possible always use autoconfig.
After this boot0 does more stuff, but this is as far as I've gotten and currently I've other priorities.
If I were you I would start with the existing dram_sun6i.c from upstream u-boot, as the A33 DRAM controller seems to be closest to the A31 one, then add in the dram_sun8i.c pll init code, and the timing stuff which I've already written, and then see where the initialization algorithm is different for the A33 and modify the dram_sun6i.c code to match what is needed to get the A33 going, if extra code is needed you MUST write NEW code.
When you submit support for this upstream you must include a Signed-off-by, and thereby you are declaring that the code is all your own and that you've the right to submit this code under the GPL license, this means that there must be absolutely no copied code in your upstream patch submission!
Also see:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documen...
Section "11) Sign your work
Basic A33 support including dram init available in my personal repo https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Thanks for your work on this, and sorry if I sound a bit harsh above, but I really need to be strict about not allowing any non GPL code into u-boot.
Regards,
Hans

Hello Hans, Thank you for the comments.
On Mon, Mar 2, 2015 at 3:55 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/ tree/master/basic_loader/bsp/bsp_for_a67.
Ah, that is both good and bad...
Now, for me good part is over, now it's just bad.
I've integrated it with mainline u-boot, still lot to do to post it to
upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
I've been working on A33 dram support too, without any source code access, instead I've been tracing what the boot0 machine code does and going from there. What I've sofar is that the code first inits the DRAM PLL / cmu dram registers, it seems that the A33 has 2 dram pll-s and that one of the dram_para fields configures which pll to use and configures some sigma-delta pattern to reduce rf interference, at least on my A33 tablet the code seems to want to pick the new / second dram pll. But I see no reason why the first one should not work, so for now if I were you I would just use the A23 dram pll / cmu setup code modified to set the one or 2 extra reset / enable bits the A33 has, but still using the old / first dram pll, we can always add support for the new one later.
Then the boot0 code calculates a load of timing parameters and writes these to registers. I've already written my own C-code reproducing the init algorithm from boot0 for this (attached) this is GPL code and you should be able to use this to replace a chunk of the bsp code. Note that I found 2 code paths based on a tpr13 bit (iirc) one for autoconfig, and one for reading values from the tpr dram_para values, my code supports only autoconfig, you can add a printf to warn if manual config is requested and still keep using autoconfig. The same goes for any other code paths were there is both a manual and an auto option, look at what actual shipped tablets are using, only support that and print a warning for the other case, were possible always use autoconfig.
After this boot0 does more stuff, but this is as far as I've gotten and currently I've other priorities.
If I were you I would start with the existing dram_sun6i.c from upstream u-boot, as the A33 DRAM controller seems to be closest to the A31 one, then add in the dram_sun8i.c pll init code, and the timing stuff which I've already written, and then see where the initialization algorithm is different for the A33 and modify the dram_sun6i.c code to match what is needed to get the A33 going, if extra code is needed you MUST write NEW code.
When you submit support for this upstream you must include a Signed-off-by, and thereby you are declaring that the code is all your own and that you've the right to submit this code under the GPL license, this means that there must be absolutely no copied code in your upstream patch submission!
Also see:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/ linux.git/tree/Documentation/SubmittingPatches
Section "11) Sign your work
Basic A33 support including dram init available in my personal repo
https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Thanks for your work on this, and sorry if I sound a bit harsh above, but I really need to be strict about not allowing any non GPL code into u-boot.
No, You've not been harsh, instead you've been helpful in this case.
Thank you for clearing my doubts. I was under impression that if we keep the copyright header, it can be accepted.
BTW, libdram as binary and used in u-boot is also GPL violation, right?
I'll see how can I re-use the A31 dram init code and get it work for A33.
Regards,
Hans

Hi,
On 02-03-15 12:51, Vishnu Patekar wrote:
Hello Hans, Thank you for the comments.
On Mon, Mar 2, 2015 at 3:55 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/ tree/master/basic_loader/bsp/bsp_for_a67.
Ah, that is both good and bad...
Now, for me good part is over, now it's just bad.
I've integrated it with mainline u-boot, still lot to do to post it to
upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
I've been working on A33 dram support too, without any source code access, instead I've been tracing what the boot0 machine code does and going from there. What I've sofar is that the code first inits the DRAM PLL / cmu dram registers, it seems that the A33 has 2 dram pll-s and that one of the dram_para fields configures which pll to use and configures some sigma-delta pattern to reduce rf interference, at least on my A33 tablet the code seems to want to pick the new / second dram pll. But I see no reason why the first one should not work, so for now if I were you I would just use the A23 dram pll / cmu setup code modified to set the one or 2 extra reset / enable bits the A33 has, but still using the old / first dram pll, we can always add support for the new one later.
Then the boot0 code calculates a load of timing parameters and writes these to registers. I've already written my own C-code reproducing the init algorithm from boot0 for this (attached) this is GPL code and you should be able to use this to replace a chunk of the bsp code. Note that I found 2 code paths based on a tpr13 bit (iirc) one for autoconfig, and one for reading values from the tpr dram_para values, my code supports only autoconfig, you can add a printf to warn if manual config is requested and still keep using autoconfig. The same goes for any other code paths were there is both a manual and an auto option, look at what actual shipped tablets are using, only support that and print a warning for the other case, were possible always use autoconfig.
After this boot0 does more stuff, but this is as far as I've gotten and currently I've other priorities.
If I were you I would start with the existing dram_sun6i.c from upstream u-boot, as the A33 DRAM controller seems to be closest to the A31 one, then add in the dram_sun8i.c pll init code, and the timing stuff which I've already written, and then see where the initialization algorithm is different for the A33 and modify the dram_sun6i.c code to match what is needed to get the A33 going, if extra code is needed you MUST write NEW code.
When you submit support for this upstream you must include a Signed-off-by, and thereby you are declaring that the code is all your own and that you've the right to submit this code under the GPL license, this means that there must be absolutely no copied code in your upstream patch submission!
Also see:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/ linux.git/tree/Documentation/SubmittingPatches
Section "11) Sign your work
Basic A33 support including dram init available in my personal repo
https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Thanks for your work on this, and sorry if I sound a bit harsh above, but I really need to be strict about not allowing any non GPL code into u-boot.
No, You've not been harsh, instead you've been helpful in this case.
Thank you for clearing my doubts. I was under impression that if we keep the copyright header, it can be accepted.
BTW, libdram as binary and used in u-boot is also GPL violation, right?
IANAL, but linking non GPL binaries into a GPL binary is not good. But in the end it does not matter even if Allwinnner does not honor the GPL, we must still honor their copyrights, this are 2 orthogonal (independent) issues.
I'll see how can I re-use the A31 dram init code and get it work for A33.
Thanks!
Regards,
Hans

On Mon, 2 Mar 2015 17:21:48 +0530 Vishnu Patekar vishnupatekar0510@gmail.com wrote:
Hello Hans, Thank you for the comments.
On Mon, Mar 2, 2015 at 3:55 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/ tree/master/basic_loader/bsp/bsp_for_a67.
Ah, that is both good and bad...
Now, for me good part is over, now it's just bad.
I've integrated it with mainline u-boot, still lot to do to post it to
upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
I've been working on A33 dram support too, without any source code access, instead I've been tracing what the boot0 machine code does and going from there. What I've sofar is that the code first inits the DRAM PLL / cmu dram registers, it seems that the A33 has 2 dram pll-s and that one of the dram_para fields configures which pll to use and configures some sigma-delta pattern to reduce rf interference, at least on my A33 tablet the code seems to want to pick the new / second dram pll. But I see no reason why the first one should not work, so for now if I were you I would just use the A23 dram pll / cmu setup code modified to set the one or 2 extra reset / enable bits the A33 has, but still using the old / first dram pll, we can always add support for the new one later.
Then the boot0 code calculates a load of timing parameters and writes these to registers. I've already written my own C-code reproducing the init algorithm from boot0 for this (attached) this is GPL code and you should be able to use this to replace a chunk of the bsp code. Note that I found 2 code paths based on a tpr13 bit (iirc) one for autoconfig, and one for reading values from the tpr dram_para values, my code supports only autoconfig, you can add a printf to warn if manual config is requested and still keep using autoconfig. The same goes for any other code paths were there is both a manual and an auto option, look at what actual shipped tablets are using, only support that and print a warning for the other case, were possible always use autoconfig.
After this boot0 does more stuff, but this is as far as I've gotten and currently I've other priorities.
If I were you I would start with the existing dram_sun6i.c from upstream u-boot, as the A33 DRAM controller seems to be closest to the A31 one, then add in the dram_sun8i.c pll init code, and the timing stuff which I've already written, and then see where the initialization algorithm is different for the A33 and modify the dram_sun6i.c code to match what is needed to get the A33 going, if extra code is needed you MUST write NEW code.
When you submit support for this upstream you must include a Signed-off-by, and thereby you are declaring that the code is all your own and that you've the right to submit this code under the GPL license, this means that there must be absolutely no copied code in your upstream patch submission!
Also see:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/ linux.git/tree/Documentation/SubmittingPatches
Section "11) Sign your work
Basic A33 support including dram init available in my personal repo
https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Thanks for your work on this, and sorry if I sound a bit harsh above, but I really need to be strict about not allowing any non GPL code into u-boot.
No, You've not been harsh, instead you've been helpful in this case.
Thank you for clearing my doubts. I was under impression that if we keep the copyright header, it can be accepted.
BTW, libdram as binary and used in u-boot is also GPL violation, right?
I'll see how can I re-use the A31 dram init code and get it work for A33.
I see that this discussion has unfortunately derailed. Vishnu, please don't take this "MUST" and "NEW code" statements from Hans as a strict requirement.
We only need Allwinner to re-license these pieces of A33 dram code under GPL. This even is not something really new and had been already done for the A10 dram code before, at the time when Tom Cubie had been an Allwinner employee and took the initiative to communicate with the free software community. As a result, we got the license status clarified for a lot of sources from both the bootloader and the linux kernel.
Now David Lanzendörfer (added to CC) is trying to basically do the same job as Tom Cubie did before. And seems like Allwinner is actually interested in having support for all the new SoC variants the in the mainline U-Boot:
http://irclog.whitequark.org/linux-sunxi/2015-02-14#11841248 http://irclog.whitequark.org/linux-sunxi/2015-02-14#11838181
Based on the irc discussion logs, I was under impression that Vishnu was already in contact with the relevant people from Allwinner. And that they actually liked his A33 bring-up work.
Also please have a look at how a similar "All rights reserved" issue with the NAND source code got recently solved:
https://github.com/allwinner-zh/bootloader/issues/4
To sum it up. Allwinner really has nothing to lose by re-licensing the A33 dram code to make it U-Boot compatible. And the same would be very much appreciated for the original Allwinner's A23 and A80 dram code too.

Hi,
On 04-03-15 13:33, Siarhei Siamashka wrote:
On Mon, 2 Mar 2015 17:21:48 +0530 Vishnu Patekar vishnupatekar0510@gmail.com wrote:
Hello Hans, Thank you for the comments.
On Mon, Mar 2, 2015 at 3:55 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/ tree/master/basic_loader/bsp/bsp_for_a67.
Ah, that is both good and bad...
Now, for me good part is over, now it's just bad.
I've integrated it with mainline u-boot, still lot to do to post it to
upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
I've been working on A33 dram support too, without any source code access, instead I've been tracing what the boot0 machine code does and going from there. What I've sofar is that the code first inits the DRAM PLL / cmu dram registers, it seems that the A33 has 2 dram pll-s and that one of the dram_para fields configures which pll to use and configures some sigma-delta pattern to reduce rf interference, at least on my A33 tablet the code seems to want to pick the new / second dram pll. But I see no reason why the first one should not work, so for now if I were you I would just use the A23 dram pll / cmu setup code modified to set the one or 2 extra reset / enable bits the A33 has, but still using the old / first dram pll, we can always add support for the new one later.
Then the boot0 code calculates a load of timing parameters and writes these to registers. I've already written my own C-code reproducing the init algorithm from boot0 for this (attached) this is GPL code and you should be able to use this to replace a chunk of the bsp code. Note that I found 2 code paths based on a tpr13 bit (iirc) one for autoconfig, and one for reading values from the tpr dram_para values, my code supports only autoconfig, you can add a printf to warn if manual config is requested and still keep using autoconfig. The same goes for any other code paths were there is both a manual and an auto option, look at what actual shipped tablets are using, only support that and print a warning for the other case, were possible always use autoconfig.
After this boot0 does more stuff, but this is as far as I've gotten and currently I've other priorities.
If I were you I would start with the existing dram_sun6i.c from upstream u-boot, as the A33 DRAM controller seems to be closest to the A31 one, then add in the dram_sun8i.c pll init code, and the timing stuff which I've already written, and then see where the initialization algorithm is different for the A33 and modify the dram_sun6i.c code to match what is needed to get the A33 going, if extra code is needed you MUST write NEW code.
When you submit support for this upstream you must include a Signed-off-by, and thereby you are declaring that the code is all your own and that you've the right to submit this code under the GPL license, this means that there must be absolutely no copied code in your upstream patch submission!
Also see:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/ linux.git/tree/Documentation/SubmittingPatches
Section "11) Sign your work
Basic A33 support including dram init available in my personal repo
https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Thanks for your work on this, and sorry if I sound a bit harsh above, but I really need to be strict about not allowing any non GPL code into u-boot.
No, You've not been harsh, instead you've been helpful in this case.
Thank you for clearing my doubts. I was under impression that if we keep the copyright header, it can be accepted.
BTW, libdram as binary and used in u-boot is also GPL violation, right?
I'll see how can I re-use the A31 dram init code and get it work for A33.
I see that this discussion has unfortunately derailed. Vishnu, please don't take this "MUST" and "NEW code" statements from Hans as a strict requirement.
We only need Allwinner to re-license these pieces of A33 dram code under GPL. This even is not something really new and had been already done for the A10 dram code before, at the time when Tom Cubie had been an Allwinner employee and took the initiative to communicate with the free software community. As a result, we got the license status clarified for a lot of sources from both the bootloader and the linux kernel.
Now David Lanzendörfer (added to CC) is trying to basically do the same job as Tom Cubie did before. And seems like Allwinner is actually interested in having support for all the new SoC variants the in the mainline U-Boot:
http://irclog.whitequark.org/linux-sunxi/2015-02-14#11841248 http://irclog.whitequark.org/linux-sunxi/2015-02-14#11838181
Based on the irc discussion logs, I was under impression that Vishnu was already in contact with the relevant people from Allwinner. And that they actually liked his A33 bring-up work.
Also please have a look at how a similar "All rights reserved" issue with the NAND source code got recently solved:
https://github.com/allwinner-zh/bootloader/issues/4
To sum it up. Allwinner really has nothing to lose by re-licensing the A33 dram code to make it U-Boot compatible. And the same would be very much appreciated for the original Allwinner's A23 and A80 dram code too.
True, if Allwinner is willing to relicense their A33 dram init code that is fine too. But until that actually happens my "MUST" and "NEW code" statements are very much strict requirements.
Regards,
Hans

Hi,
On 02-03-15 11:25, Hans de Goede wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
Ah, that is both good and bad...
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
Ok, so something (to me) quite unexpected has happened and Allwinner has just released what seems to be ALL there boot0 code under the GPL, it can found here:
https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/boot0 https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/bsp
Specifically interesting for the discussion at hand is: https://github.com/allwinner-zh/bootloader/blob/master/basic_loader/bsp/bsp_...
Which caries a GPL header now. This completely changes my story above, whatever you have (or had, sorry) was fine. It should still be cleaned up a bit, but all my worries about copy and pasting non GPL code are gone now.
Regards,
Hans

On Sat, 07 Mar 2015 20:06:27 +0100 Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 02-03-15 11:25, Hans de Goede wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
Ah, that is both good and bad...
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
Ok, so something (to me) quite unexpected has happened and Allwinner has just released what seems to be ALL there boot0 code under the GPL, it can found here:
https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/boot0 https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/bsp
Specifically interesting for the discussion at hand is: https://github.com/allwinner-zh/bootloader/blob/master/basic_loader/bsp/bsp_...
Which caries a GPL header now. This completely changes my story above, whatever you have (or had, sorry) was fine. It should still be cleaned up a bit, but all my worries about copy and pasting non GPL code are gone now.
It is strange that this has caught you by surprise, because you had been informed about what is going on:
http://lists.denx.de/pipermail/u-boot/2015-March/207174.html
Basically, we need to thank David and Vishnu for negotiating this with Allwinner (and this communication has been going on for some time already), which resulted in a reasonable solution in the end. You have also played your role well. My intervention was only needed to ensure that Vishnu does not get discouraged by your response, which originally sounded like only a single less than perfect solution was possible :-)
Yes, we are kinda lucky to have discovered this apparently leaked A33 dram code. I don't approve the actions of whoever is responsible for this leak. But we ended up in a situation where the "bad" guys (competitors?) have already got access to the code to learn all the "secrets", while the "good" guys (us) could not use the code because of the missing license notices. And Allwinner just made a rational decision how to deal with it (in the same way as this happened with the previous code leaks). Having also the A23, A83T and A80 dram code open sourced under the GPL license is very much appreciated. It means that U-Boot can get full support for A83T and A80 too.
Special thanks to Vishu for not trying to hide the origin of the A33 dram code. I particularly like full transparency and honesty in handling this case.
I'm still not completely happy about the presence of magic numbers all over the place (for example, Rockchip sources for very similar dram controllers have proper named identifiers for the hardware register bitfields) and other code quality problems. In a prefect world, we would also get full documentation for the dram controllers and the errata lists. But even the current source code is enough to move from the dead point.

Hello, It's sensible work by Allwinner to release the dram code under GPLv2.
Now, we can have mainline u-boot support for A33 soon.
Hans, Yes, I've very basic A33 dts created based on A23, still lot to do.
I'll send the u-boot patches soon. so that, you all can review it.
On Sun, Mar 8, 2015 at 5:33 AM, Siarhei Siamashka siarhei.siamashka@gmail.com wrote:
On Sat, 07 Mar 2015 20:06:27 +0100 Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 02-03-15 11:25, Hans de Goede wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
Ah, that is both good and bad...
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
Ok, so something (to me) quite unexpected has happened and Allwinner has just released what seems to be ALL there boot0 code under the GPL, it can found here:
https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/boot0 https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/bsp
Specifically interesting for the discussion at hand is: https://github.com/allwinner-zh/bootloader/blob/master/basic_loader/bsp/bsp_...
Which caries a GPL header now. This completely changes my story above, whatever you have (or had, sorry) was fine. It should still be cleaned up a bit, but all my worries about copy and pasting non GPL code are gone now.
It is strange that this has caught you by surprise, because you had been informed about what is going on:
http://lists.denx.de/pipermail/u-boot/2015-March/207174.html
Basically, we need to thank David and Vishnu for negotiating this with Allwinner (and this communication has been going on for some time already), which resulted in a reasonable solution in the end. You have also played your role well. My intervention was only needed to ensure that Vishnu does not get discouraged by your response, which originally sounded like only a single less than perfect solution was possible :-)
Yes, we are kinda lucky to have discovered this apparently leaked A33 dram code. I don't approve the actions of whoever is responsible for this leak. But we ended up in a situation where the "bad" guys (competitors?) have already got access to the code to learn all the "secrets", while the "good" guys (us) could not use the code because of the missing license notices. And Allwinner just made a rational decision how to deal with it (in the same way as this happened with the previous code leaks). Having also the A23, A83T and A80 dram code open sourced under the GPL license is very much appreciated. It means that U-Boot can get full support for A83T and A80 too.
Special thanks to Vishu for not trying to hide the origin of the A33 dram code. I particularly like full transparency and honesty in handling this case.
I'm still not completely happy about the presence of magic numbers all over the place (for example, Rockchip sources for very similar dram controllers have proper named identifiers for the hardware register bitfields) and other code quality problems. In a prefect world, we would also get full documentation for the dram controllers and the errata lists. But even the current source code is enough to move from the dead point.
-- Best regards, Siarhei Siamashka

Hi,
On Mon, Mar 9, 2015 at 4:39 PM, Vishnu Patekar vishnupatekar0510@gmail.com wrote:
Hello, It's sensible work by Allwinner to release the dram code under GPLv2.
Now, we can have mainline u-boot support for A33 soon.
Hans, Yes, I've very basic A33 dts created based on A23, still lot to do.
About the dts, so far the memory maps look the same. I haven't checked the clocks or interrupts, but I bet they are the same as well.
Could we use an overlay over A23 with just the different pieces overriden? Though they're not the same piece of silicon, they are damn close. Maybe even the PIO is the same.
Maxime, any thoughts?
Regards ChenYu
I'll send the u-boot patches soon. so that, you all can review it.
On Sun, Mar 8, 2015 at 5:33 AM, Siarhei Siamashka siarhei.siamashka@gmail.com wrote:
On Sat, 07 Mar 2015 20:06:27 +0100 Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 02-03-15 11:25, Hans de Goede wrote:
Hi,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
Ah, that is both good and bad...
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Integrated sounds as if you've copied pieces of code from the bsp code you've found into mainline u-boot. That is a big no no (this the bad part). AFAIK the bsp code does not come with a GPL license header, and Allwinner does not want to release these bits under the GPL for whatever reasons, a lot can be said about this, but in the end currently the bsp code is not GPL licensed, so we cannot use it / copy from it. There can be no discussion on this, when you're submitting this upstream you must not have any literal copied code in the patch you're sending upstream.
You can use non copyrightable information from the bsp sources like register names and the initialization algorithm (IANAL), but you must 100% write your own code!
Ok, so something (to me) quite unexpected has happened and Allwinner has just released what seems to be ALL there boot0 code under the GPL, it can found here:
https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/boot0 https://github.com/allwinner-zh/bootloader/tree/master/basic_loader/bsp
Specifically interesting for the discussion at hand is: https://github.com/allwinner-zh/bootloader/blob/master/basic_loader/bsp/bsp_...
Which caries a GPL header now. This completely changes my story above, whatever you have (or had, sorry) was fine. It should still be cleaned up a bit, but all my worries about copy and pasting non GPL code are gone now.
It is strange that this has caught you by surprise, because you had been informed about what is going on:
http://lists.denx.de/pipermail/u-boot/2015-March/207174.html
Basically, we need to thank David and Vishnu for negotiating this with Allwinner (and this communication has been going on for some time already), which resulted in a reasonable solution in the end. You have also played your role well. My intervention was only needed to ensure that Vishnu does not get discouraged by your response, which originally sounded like only a single less than perfect solution was possible :-)
Yes, we are kinda lucky to have discovered this apparently leaked A33 dram code. I don't approve the actions of whoever is responsible for this leak. But we ended up in a situation where the "bad" guys (competitors?) have already got access to the code to learn all the "secrets", while the "good" guys (us) could not use the code because of the missing license notices. And Allwinner just made a rational decision how to deal with it (in the same way as this happened with the previous code leaks). Having also the A23, A83T and A80 dram code open sourced under the GPL license is very much appreciated. It means that U-Boot can get full support for A83T and A80 too.
Special thanks to Vishu for not trying to hide the origin of the A33 dram code. I particularly like full transparency and honesty in handling this case.
I'm still not completely happy about the presence of magic numbers all over the place (for example, Rockchip sources for very similar dram controllers have proper named identifiers for the hardware register bitfields) and other code quality problems. In a prefect world, we would also get full documentation for the dram controllers and the errata lists. But even the current source code is enough to move from the dead point.
-- Best regards, Siarhei Siamashka
-- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/d/optout.

Hi,
On 09-03-15 10:04, Chen-Yu Tsai wrote:
Hi,
On Mon, Mar 9, 2015 at 4:39 PM, Vishnu Patekar vishnupatekar0510@gmail.com wrote:
Hello, It's sensible work by Allwinner to release the dram code under GPLv2.
Now, we can have mainline u-boot support for A33 soon.
Hans, Yes, I've very basic A33 dts created based on A23, still lot to do.
About the dts, so far the memory maps look the same. I haven't checked the clocks or interrupts, but I bet they are the same as well.
Could we use an overlay over A23 with just the different pieces overriden? Though they're not the same piece of silicon, they are damn close. Maybe even the PIO is the same.
+1, I wanted to do / suggest the same myself.
Regards,
Hans

Yes, except couple of additional clocks for A33, others seem to be same as A23 including PIO.
I think, it's possible to overlay over A23.
On Mon, Mar 9, 2015 at 2:35 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi,
On 09-03-15 10:04, Chen-Yu Tsai wrote:
Hi,
On Mon, Mar 9, 2015 at 4:39 PM, Vishnu Patekar vishnupatekar0510@gmail.com wrote:
Hello, It's sensible work by Allwinner to release the dram code under GPLv2.
Now, we can have mainline u-boot support for A33 soon.
Hans, Yes, I've very basic A33 dts created based on A23, still lot to do.
About the dts, so far the memory maps look the same. I haven't checked the clocks or interrupts, but I bet they are the same as well.
Could we use an overlay over A23 with just the different pieces overriden? Though they're not the same piece of silicon, they are damn close. Maybe even the PIO is the same.
+1, I wanted to do / suggest the same myself.
Regards,
Hans

On Mon, Mar 09, 2015 at 05:04:15PM +0800, Chen-Yu Tsai wrote:
Hi,
On Mon, Mar 9, 2015 at 4:39 PM, Vishnu Patekar vishnupatekar0510@gmail.com wrote:
Hello, It's sensible work by Allwinner to release the dram code under GPLv2.
Now, we can have mainline u-boot support for A33 soon.
Hans, Yes, I've very basic A33 dts created based on A23, still lot to do.
About the dts, so far the memory maps look the same. I haven't checked the clocks or interrupts, but I bet they are the same as well.
Could we use an overlay over A23 with just the different pieces overriden? Though they're not the same piece of silicon, they are damn close. Maybe even the PIO is the same.
I'd prefer something like sun8i.dtsi, and then include it from both sun8i-a23.dtsi and sun8i-a33.dtsi, like we did recently for sun5i, but that's a detail.
But yeah, if they're that close, we should definitely share as much as possible.
Maxime

Hi Vishnu,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/tree/master/basic_loader/bsp/b....
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Basic A33 support including dram init available in my personal repo https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Just a quick heads up that since I've some time to work on this now, and we've not seen any new code from you in a month, that I'm going to pick up your patches, clean them up and them submit them upstream.
Regards,
Hans

Hello Hans, I wish I could have spent more time working on it. however, I could not.
Thanks for taking this up.
On Mon, Apr 6, 2015 at 2:46 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi Vishnu,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/ tree/master/basic_loader/bsp/bsp_for_a67.
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Basic A33 support including dram init available in my personal repo https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Just a quick heads up that since I've some time to work on this now, and we've not seen any new code from you in a month, that I'm going to pick up your patches, clean them up and them submit them upstream.
Regards,
Hans

Hi,
On 06-04-15 12:48, Vishnu Patekar wrote:
Hello Hans, I wish I could have spent more time working on it. however, I could not.
No problem, thanks for the initial code, and I'm happy to hear that you've no objections against me taking over from you.
Thanks for taking this up.
You're welcome.
Regards,
Hans
On Mon, Apr 6, 2015 at 2:46 PM, Hans de Goede hdegoede@redhat.com wrote:
Hi Vishnu,
On 01-03-15 19:42, Vishnu Patekar wrote:
Allwinner A33 tablets comes with the libdram binary, fortunately I've found the libdram code at https://github.com/realthunder/a33_bootloader/ tree/master/basic_loader/bsp/bsp_for_a67.
I've integrated it with mainline u-boot, still lot to do to post it to upstream
Basic A33 support including dram init available in my personal repo https://github.com/vishnupatekar/u-boot-sunxi/tree/a33-dram
I could able to boot u-boot over fel, and get u-boot command prompt on microSD pins which are multiplexed with UART0.
The device page for A33 tablet which I've is here: http://linux-sunxi.org/Softwinner_astar-rda
Just a quick heads up that since I've some time to work on this now, and we've not seen any new code from you in a month, that I'm going to pick up your patches, clean them up and them submit them upstream.
Regards,
Hans
participants (5)
-
Chen-Yu Tsai
-
Hans de Goede
-
Maxime Ripard
-
Siarhei Siamashka
-
Vishnu Patekar