rellla changed the topic of #linux-sunxi to: Allwinner/sunxi /development discussion - did you try looking at our wiki? https://linux-sunxi.org - Don't ask to ask. Just ask and wait! - https://github.com/linux-sunxi/ - Logs at http://irclog.whitequark.org/linux-sunxi - *only registered users can talk*
longsleep has quit [Quit: No Ping reply in 180 seconds.]
longsleep has joined #linux-sunxi
GrimKriegor has quit [Read error: Connection reset by peer]
GrimKriegor_ has joined #linux-sunxi
longsleep has quit [Quit: No Ping reply in 180 seconds.]
longsleep has joined #linux-sunxi
longsleep has quit [Client Quit]
longsleep has joined #linux-sunxi
kever has quit [Ping timeout: 272 seconds]
kever has joined #linux-sunxi
longsleep has quit [Quit: No Ping reply in 180 seconds.]
longsleep has joined #linux-sunxi
akaizen has joined #linux-sunxi
<tautologico> Rafael1980: what board do you have?
longsleep has quit [Quit: No Ping reply in 180 seconds.]
kever has quit [Quit: No Ping reply in 180 seconds.]
longsleep has joined #linux-sunxi
kever has joined #linux-sunxi
<Rafael1980> custom
vagrantc has quit [Quit: leaving]
<Rafael1980> but for the kernel I need the sun8i
<Rafael1980> for the u-boot I need the target board
ganbold has joined #linux-sunxi
<Rafael1980> in this case Im wondering if I have a custom board how do I proceed
<Rafael1980> ??
<apritzel> for sunxi boards you should be good by just adding a _defconfig file in the configs/ directory and providing the .dts file in arch/arm/dts
<apritzel> typically you copy something which is reasonably close
<apritzel> there should be no need to add real code or header files for a new board (which other platforms tend to require)
<apritzel> Rafael1980: see U-Boot commit b972831c3cd2 for an example
leviathanch has joined #linux-sunxi
<Rafael1980> ok
<Rafael1980> can you give a link?
<Rafael1980> for the U-boot commit
<Rafael1980> b972831c3cd2
<apritzel> Rafael1980: out of curiosity: which kernel has sun4i_defconfig, sun5i_defconfig and sun8i_defconfig?
<Rafael1980> dont know but according to this link http://linux-sunxi.org/Linux_Kernel
<apritzel> Rafael1980: btw: if you have a checked out U-Boot git tree, git show b972831c3cd2 would be your friend
<Rafael1980> the sunXi_defconfig is needed
<Rafael1980> and in this link
<Rafael1980> in build kernel you should see the sun8iw8p1smp_zero_diy_defconfig
<apritzel> this is quite outdated, for ancient versions of Linux
<Rafael1980> im the new guy in the hood
<apritzel> I suggest to change to mainline, this is much cleaner and you get more help from people
<apritzel> Rafael1980: mind the fat disclaimer at the beginning of this page
<Rafael1980> yeap
<apritzel> then all you need is a .dts file, which should be the same for both the kernel and U-Boot
<apritzel> for the kernel you are done (use the existing sunxi_defconfig or multi_v7_defconfig)
<apritzel> for U-Boot you need a rather simple <your_board>_defconfig in configs/
<apritzel> Rafael1980: V3s?
<Rafael1980> V3s
<apritzel> so I suggest you copy from LicheePi
<Rafael1980> can you give the link for the mainline
<Rafael1980> yeah i see that too
<apritzel> git.kernel.org ;-)
<Rafael1980> AFAIK the dts file need to be generate and is according to the hardware is used
<apritzel> you could actually have some success already by just using a LicheePi build
<apritzel> yes, the .dts describes how the board uses the SoC: which peripherals are used, using which pins, and how the external regulators are connected
<Rafael1980> I already dowload the u-bbot and kernel for mainline
<apritzel> reading one should give you some clue
<Rafael1980> has LInaro for toolchain
<Rafael1980> buildroot2018
<apritzel> if you a fairly recent distro on your PC, you could just use the cross compilers provided using in the normal repositories
<Rafael1980> thanks for the tip I will check it
<apritzel> Rafael1980: to summarise my rubbish typing: apt-get install gcc-arm-linux-gnueabihf
<Rafael1980> im using opensuse
<Rafael1980> Linaro is fine
<Rafael1980> buildroot too
<Rafael1980> I use it to do something in fpga
<Rafael1980> building xilinx kernels
longsleep has quit [Remote host closed the connection]
<Rafael1980> to do that I needed the dts file
<Rafael1980> sorry to ask but how can I generate the dts file for the V3s
<Rafael1980> normally in fpga is the combination of the .mss and .xml file
<Rafael1980> but in arm no clue
<apritzel> as I said: you copy an existing one and adjust that to your needs
<apritzel> I'd start with stripping it to the bare minimal, just serial, for instance
<apritzel> the adding stuff like MMC and USB
longsleep has joined #linux-sunxi
<apritzel> the main thing is to find the regulators and describe them
<apritzel> so how does board provide power for the SD card and USB, for instance
<apritzel> if you are lucky, this is either not needed or just a GPIO
<apritzel> the sun8i-v3s-licheepi-zero.dts looks fairly simple, so chances are it actually works without changes
apritzel has quit [Ping timeout: 250 seconds]
lurchi__ has quit [Quit: Konversation terminated!]
longsleep has quit [Quit: No Ping reply in 180 seconds.]
longsleep has joined #linux-sunxi
longsleep has quit [Client Quit]
juri_ has quit [Remote host closed the connection]
longsleep has joined #linux-sunxi
leviathanch has quit [Remote host closed the connection]
juri_ has joined #linux-sunxi
<Rafael1980> im looking the dts file and is very simple
longsleep has quit [Quit: No Ping reply in 180 seconds.]
<Rafael1980> the sd card uart0 usb
<Rafael1980> if i need the ethernet I need to add this tiem to the dts
longsleep has joined #linux-sunxi
kever has quit [Ping timeout: 250 seconds]
victhor has quit [Remote host closed the connection]
_whitelogger has joined #linux-sunxi
kelvan has quit [Remote host closed the connection]
merlin1991 has quit [Remote host closed the connection]
merlin1991 has joined #linux-sunxi
kelvan has joined #linux-sunxi
return0e has quit [Ping timeout: 240 seconds]
return0e has joined #linux-sunxi
valkyr1e has joined #linux-sunxi
_whitelogger_ has joined #linux-sunxi
IgorPec has joined #linux-sunxi
_whitelogger has quit [Ping timeout: 268 seconds]
_whitelogger has joined #linux-sunxi
_whitelogger has joined #linux-sunxi
dddddd has quit [Remote host closed the connection]
nuuuciano has quit [Ping timeout: 250 seconds]
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 240 seconds]
nuuuciano has joined #linux-sunxi
\\Mr_C\\ has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 240 seconds]
chomwitt has joined #linux-sunxi
\\Mr-C\\ has joined #linux-sunxi
return0e has quit [Read error: Connection reset by peer]
\\Mr_C\\ has quit [Ping timeout: 240 seconds]
\\Mr_C\\ has joined #linux-sunxi
return0e has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 240 seconds]
leviathanch has joined #linux-sunxi
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 240 seconds]
clemens3_ has quit [Ping timeout: 268 seconds]
clemens3_ has joined #linux-sunxi
\\Mr_C\\ has joined #linux-sunxi
\\Mr-C\\ has quit [Ping timeout: 240 seconds]
<catphish> morning
BenG83 has joined #linux-sunxi
clemens3_ has quit [Ping timeout: 245 seconds]
BenG has joined #linux-sunxi
\\Mr-C\\ has joined #linux-sunxi
\\Mr_C\\ has quit [Ping timeout: 240 seconds]
\\Mr-C\\ has quit [Quit: (Read error: Connection reset by beer)]
BenG83 has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
\\Mr_C\\ has joined #linux-sunxi
apritzel has quit [Ping timeout: 240 seconds]
pgreco has quit [Ping timeout: 246 seconds]
pgreco has joined #linux-sunxi
pgreco has quit [Ping timeout: 240 seconds]
apritzel has joined #linux-sunxi
pgreco has joined #linux-sunxi
Kwiboo- has joined #linux-sunxi
Kwiboo has quit [Ping timeout: 246 seconds]
apritzel has quit [Ping timeout: 245 seconds]
Kwiboo- has quit [Quit: .]
Kwiboo has joined #linux-sunxi
clemens3_ has joined #linux-sunxi
dddddd has joined #linux-sunxi
victhor has joined #linux-sunxi
Kwiboo has quit [Quit: .]
Kwiboo has joined #linux-sunxi
willmore has quit [Ping timeout: 250 seconds]
<catphish> jernej: if you're around some time and don't mind, i have some questions, probably endless questions, but i'll try to limit them :) the biggest of which being about clock speeds, i want to do 1080p@60 which requires a pixel clock of 148.5MHz, but at what speed should i actually run my PLL?
<catphish> i get the impression it should be a 297MHz clock with a /2 divider somewhere, but i can't see where the division takes place
<jernej> check kernel driver - PLL should run with at least 192 MHz, so yes, you should take 297MHz / 2 combination
<jernej> divider 2 is burried in HDMI PHY code
<catphish> so run the PLL at 297 and divide by 2 in HDMI_CLK_REG?
<jernej> take a look at Linux driver, it is more readable
<jernej> no, divider in HDMI_CLK_REG doesn't have any effect
f0xx has joined #linux-sunxi
<catphish> oh, the PHY does the division? what about the rest of the HDMI module?
<jernej> I tested various combinations and it seems that HDMI_CLK_REG divider doesn't have any effect
<jernej> clocks here are a bit unclear
<jernej> most importantly, HDMI PHY has to run at target pixel clock
<catphish> ok, and this is done using the internal divider? (configured with the magic constants)?
<catphish> PHY_PLL_CFG1 and PHY_PLL_CFG2
<jernej> as I said, take a look at Linux HDMI PHY driver, there is much less magic constants
<catphish> just trying to find it
<jernej> later is for clock
victhor has quit [Remote host closed the connection]
<catphish> well thats plenty to read, thanks
apritzel has joined #linux-sunxi
aalm has quit [Read error: Connection reset by peer]
\\Mr_C\\ has quit [Ping timeout: 250 seconds]
LargePrime has quit [Remote host closed the connection]
<catphish> it's frustrating that i get zero feedback about whether i'm on track or not until everything works and a get video on screen, but i feel like every day i'm understanding it better, so hopefully it'll fall into place
apritzel has quit [Ping timeout: 240 seconds]
scelestic has quit [Remote host closed the connection]
leviathanch has quit [Remote host closed the connection]
lurchi_ has joined #linux-sunxi
lurchi_ is now known as lurchi__
AneoX has quit [Ping timeout: 250 seconds]
\\Mr_C\\ has joined #linux-sunxi
AneoX has joined #linux-sunxi
foxx_ has joined #linux-sunxi
f0xx has quit [Ping timeout: 268 seconds]
Rafael1980 has quit [Quit: Konversation terminated!]
Rafael1980 has joined #linux-sunxi
netlynx has joined #linux-sunxi
lurchi__ is now known as lurchi_
BenG has quit [Quit: Leaving]
apritzel has joined #linux-sunxi
lurchi_ is now known as lurchi__
Rafael1980 has quit [Quit: Konversation terminated!]
Rafael1980 has joined #linux-sunxi
Andy-D has quit [Ping timeout: 250 seconds]
Andy-D has joined #linux-sunxi
Nyuutwo has quit [Ping timeout: 250 seconds]
Amit_T has joined #linux-sunxi
kaspter has quit [Read error: Connection reset by peer]
kaspter has joined #linux-sunxi
AneoX has quit [Ping timeout: 240 seconds]
AneoX has joined #linux-sunxi
AneoX has quit [Quit: Textual IRC Client: www.textualapp.com]
apritzel has quit [Ping timeout: 245 seconds]
<catphish> i assume it works, but i can't make sense of it with respect to https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/sun4i/sun8i_hdmi_phy.c#L163
<jernej> catphish: that's a bug, obviously, but I don't know how big. There's a plenty of settings which can be changed and have no apparent effect.
apritzel has joined #linux-sunxi
<jernej> A20 HDMI PHY has this CNT_INT setting too, but there is same amount of explanation what it does - none
victhor has joined #linux-sunxi
<catphish> i see, might just apply the magic constants from https://i.imgur.com/VEzv1c3.png to get started
<jernej> you can try
aalm has joined #linux-sunxi
IgorPec has quit [Ping timeout: 250 seconds]
reinforce has joined #linux-sunxi
fALSO has quit [Quit: "Girl with little red bike peddle ass all over town!"]
fALSO has joined #linux-sunxi
book` has quit [Ping timeout: 252 seconds]
<catphish> jernej: thanks for all your help, my display driver now works :) albeit with a lot of hardcoded values and only a blue test card output, much happy
<catphish> i was able to crack it in the end by taking a different approach, booting via u-boot and testing each part of my init code until i found the line that broke u-boot's working config, turns out the main problem was that i was forgetting to divide the TCON clock :)
Asara has quit [Ping timeout: 272 seconds]
random_yanek has quit [Ping timeout: 250 seconds]
random_yanek has joined #linux-sunxi
random_yanek has quit [Max SendQ exceeded]
Asara has joined #linux-sunxi
random_yanek has joined #linux-sunxi
Asara has quit [Read error: Connection reset by peer]
apritzel has quit [Ping timeout: 245 seconds]
book` has joined #linux-sunxi
<catphish> not yet "good" but definitely functional at 1080p60 :) https://github.com/catphish/allwinner-bare-metal/blob/master/display.c
tllim has joined #linux-sunxi
lurchi__ is now known as lurchi_
Asara has joined #linux-sunxi
<Rafael1980> catphish tobuild the u-boot I need a defconfig
<Rafael1980> this is the defconfig for the licheePi
<Rafael1980> I guess I can make a menuconfig in the u-boot folder and set those parameters and thenn make a
<Rafael1980> savedefconfig
<Rafael1980> is correct?
<jernej> catphish: I'm glad it works
<catphish> jernej: it means i won't be bothering you over christmas :)
<jernej> no worries
<jernej> I'm a bit surprised how little registers you have to set :)
<jernej> btw, your code wouldn't work if you would like to change resolution
<jernej> there is a bug in HDMI controller
<catphish> i read something about users being unable to change their resolutions in linux
<jernej> ah, it's not that you can't change, but it shows magenta line at border
<catphish> that's really interesting, because when i was testing booting with u-boot then re-initializing with my own code, i got a red line down the left
<catphish> i couldn't explain it
<catphish> but it went away when i only initialized once
<jernej> that's probably it
<jernej> anyway, there is a workaround
lurchi_ is now known as lurchi__
<jernej> http://git.denx.de/?p=u-boot/u-boot-sunxi.git;a=blob;f=drivers/video/dw_hdmi.c;h=229bd63c97c8222b3ddbfbbb1985ddca47140a0b;hb=HEAD#l488
<catphish> i don't think my code will ever need to switch resolution, i will either hardcode 1080p (because my target is TVs) or i will detect the supported resolution at boot and stick to it, worth knowing the workaround though
<catphish> oh, the overflow condition, i saw that code, i didn't know if/when i'd need to execute it
<catphish> well thanks once again for your help, i still don't *really* understand how the HDMI block is pixel-clocked
<catphish> but i at least know how to select the clock for the PHY, and that seems to be enough
<catphish> i can only assume the remainder of the HDMI block is clocked via the PHY's PLL
<catphish> and as long as that matches the clock of the TCON, it's happy
<catphish> the only part of the code i didn't implement was the video packetizer, the defaults seem fine
<jernej> I'm not sure either and I studied it much longer than you :)
<catphish> well my work is mostly just a poor immitation of yours! but it will serve my needs nicely
Amit_T has quit [Quit: Leaving]
lurchi__ is now known as lurchi_
netlynx has quit [Quit: Ex-Chat]
<catphish> now to have some fun wiith the DE
<jernej> that shouldn't be hard
<jernej> just be sure that you zero out important ranges even if there is no register documented
<jernej> I was a bit puzzled why code doesn't work after I tripple checked (or more) all register values
<jernej> but zeroing whole range worked nicely
Nyuutwo has joined #linux-sunxi
<catphish> worth knowing, thanks
lurchi_ is now known as lurchi__
AneoX has joined #linux-sunxi
dev1990 has joined #linux-sunxi
dev1990_ has quit [Ping timeout: 240 seconds]
return0e_ has joined #linux-sunxi
return0e has quit [Ping timeout: 246 seconds]
AneoX has quit [Quit: Textual IRC Client: www.textualapp.com]
popolon has joined #linux-sunxi
BroderTuck has joined #linux-sunxi
<BroderTuck> catphish: I see that you're making progress! When I try your latest code from your github my hdmi tv turns blue for a few seconds, and before that the led at PA15 is toggled. Does anything happen for you if you try toggling the LED at PL10 instead?
Mandragor_ has quit [Ping timeout: 246 seconds]
<catphish> BroderTuck: firstly, that is exactly what is supposed to happen currently, so glad to hear it, it blinks A15, then outputs a blue test screen for 4 seconds, then reboots
Mandragor has joined #linux-sunxi
<catphish> should be trivial to blink another LED, i'll try
<catphish> BroderTuck: L10 doesn't work, might be an issue with my PORTL code, i hadn't tested it
<BroderTuck> Ok, so it's just not on my device PL10 doesn work, good to know.
<catphish> i'll check the code now
<BroderTuck> PORTL is written in the dts as r_pio 0, rather than the pio that the earlier pin banks use, so I guess there's something special that needs to be done for it to work. I have no idea what, tho.
foxx_ has quit [Ping timeout: 240 seconds]
<catphish> yeah, PORTL is accessed differently from the others, my code is supposed to already handle that, but i guess i made a mistake
reinforce has quit [Quit: Leaving.]
<catphish> i'm really not sure why that doesn't work :(
vagrantc has joined #linux-sunxi
<smaeul> catphish: did you set up the clocks/reset for the R_PIO controller?
<smaeul> it's a second copy of the PIO IP block
<catphish> smaeul: nope, i'm just checking that now to see if there's gating for it
<catphish> ah here we go, there is :) i'll sort that out now
<catphish> thanks
<catphish> this is almost certainly a clocking problem, but i can't find a clock setting for R_PIO
<BroderTuck> I'm trying to verify if the second led is really on PL10 on my device (it's not a dev board, so no schematics available, and the fex file is buried on the nand, which mainline linux wouldnt be able to read)
<catphish> BroderTuck: i'll shout as soon as it works on my board, where it definitely is on PL10
<smaeul> catphish: it's documented in the PRCM section of the A83T manual, or you can look at the Linux code https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/clk/sunxi-ng/ccu-sun8i-r.c
<catphish> i think the port l clock docs are missing for the H3
<smaeul> yes, H3 doesn't have PRCM documentation
<catphish> smaeul: not sure if i'm being blind, i don't see it in that code you linked
<catphish> but i will pull an A83T manual and copy from that
<smaeul> static SUNXI_CCU_GATE(apb0_pio_clk, "apb0-pio", "apb0",
<smaeul> 0x28, BIT(0), 0);
<smaeul> so it's bit 0 of the register at R_PRCM+0x28
<catphish> oh i see, it's a whole module whose docs are missing R_PRCM = 0x01F01400
<catphish> so hopefully APB0_CLK_GATING_REG |= 1 will sort it
<catphish> BroderTuck: pull and give it a try now :)
<BroderTuck> catphish: Well, I see that the code is there, but no effect on the PL10 led. Does it work for you?
<catphish> yep, mine flashes now
<catphish> on my orange pi one, it flashes red then green
<catphish> your board must be different
<catphish> BroderTuck: does any software turn on the LED for you? linux?
<catphish> you could always write a loop to try all the pins on all the ports til you find it :)
<BroderTuck> Ok, I'll try some trial and error and see if I manage to find something.
<catphish> pretty sure the code works now though at least
<BroderTuck> yeah, sine you see flashes of both colours
<catphish> indeed
<catphish> i'm going to get in and write the rest of the display driver now, blue screen is boring
<catphish> *get on
<Rafael1980> its me again
<Rafael1980> I have the linux-4.20-rc7
<Rafael1980> inside config folder(arch-->arm-->configs)
<Rafael1980> is the sunxi_defconfig
<Rafael1980> can I use this defconfig to build the kernel for the V3s?
lurchi__ is now known as lurchi_
BenG83 has joined #linux-sunxi
<BroderTuck> Rafael1980: I think so yes. Last time i checked, the sunxi_defconfig was missing CONFIG_USB_STORAGE tho, depending on your use case this might be something you want enabled
<Rafael1980> so ..to resume..to be able to make a SD card to boot the V3s I need to do: 1) build u-boot make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- LicheePi_Zero_defconfig.....to build the kernel make ARCH=arm sunxi_defconfig---build the sunxi-tools (just make inside folder) and build rootfs using buildroot (do I need a dts here)?? is thhose steps correct? miss something in the way?
lurchi_ is now known as lurchi__
<catphish> Rafael1980: have you read http://linux-sunxi.org/Manual_build_howto
<catphish> what should cover most of what you need to do
lurchi__ is now known as lurchi_
BroderTuck has quit [Quit: -ENODAYLEFT]
sunshavi has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
qeed has quit [Quit: Leaving]
apritzel has quit [Ping timeout: 244 seconds]
sunshavi has joined #linux-sunxi
chomwitt has quit [Ping timeout: 250 seconds]
apritzel has joined #linux-sunxi