New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lantiq: new subtarget and two device updates #888

Closed
wants to merge 7 commits into
base: master
from

Conversation

Projects
None yet
5 participants
@mcmilk

mcmilk commented Feb 26, 2017

This patchset will re-add the Amazon-SE SoC to LEDE.

This SoC is used on a lot low budget ADSL2+ Modem devices.
The two devices Netgear DGN1000B and Allnet ALL0333CJ are the first ones in this target.

@blogic

This comment has been minimized.

Contributor

blogic commented Feb 27, 2017

@hauke @mkresin @mcmilk

do we need to make changes to the dsl packages ? apart form that LGTM

@ghost

This comment has been minimized.

ghost commented Feb 27, 2017

@blogic

the dsl packages compile fine currently. But the modem firmware is not correctly loaded by the dsl_cpe_control binary. I am trying to find the reason for that with some debugging today...

here is some output, if someone has also interest in it:
[ 29.405962] [IFX_MEI_RunAdslModem 1369]: Modem failed to be ready!
[ 29.410889] [IFX_MEI_Ioctls 2564]: IFX_MEI_RunAdslModem() error...
[ 32.372792] [IFX_MEI_RunAdslModem 1369]: Modem failed to be ready!
[ 32.377832] [IFX_MEI_Ioctls 2564]: IFX_MEI_RunAdslModem() error...
[ 32.704550] random: nonblocking pool is initialized
[ 34.676645] [IFX_MEI_RunAdslModem 1369]: Modem failed to be ready!
[ 34.681547] [IFX_MEI_Ioctls 2564]: IFX_MEI_RunAdslModem() error...

PS: I had found one double define in this file:
package/kernel/lantiq/ltq-atm/src/ifxmips_atm_amazon_se.c

  • EMA_CMD_BASE_ADDR and some other definitions are defined two times...
  • when I know the correct one, I will submit a fix for it
@@ -183,4 +190,3 @@ ucidef_set_interface_wan "$interface_wan" "pppoe"
board_config_flush
exit 0

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

Please keep this newline

This comment has been minimized.

@mcmilk

mcmilk Feb 27, 2017

There are two enters in the end. Is this a wanted feature ?

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

no it isn't a wanted feature. but that change is unrelated to your commit and should be fixed in a separate (cleanup) commit.

reg = <0x0 0x1000000>; // 16MB
};
// does not work at fpi@10000000 /TR

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

drop this and all following comments

This comment has been minimized.

@mcmilk

mcmilk Feb 27, 2017

Yes, will do this.

gpio-leds {
compatible = "gpio-leds";
/* POWER: two led's: 1x green, 1x red */

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

please add red:power to the dts

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

ignore this one. failed to read your comment. The led is either green or red. But never off.

This comment has been minimized.

@mcmilk

mcmilk Feb 27, 2017

Yes, this is sth. like an double LED, so I added this extra comment there.

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

I would add it to the commit message. but no strong opinion on this. for sure it should be documented.

lan: lan {
label = "all0333cj:green:lan";
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
default-state = "keep";

This comment has been minimized.

@mkresin

mkresin Feb 27, 2017

Contributor

Why does this led has default-state keep?

This comment has been minimized.

@mcmilk

mcmilk Feb 27, 2017

This was a test, must be removed. Nice catch, thank you.

@mkresin

This comment has been minimized.

Contributor

mkresin commented Feb 27, 2017

Please document the rootfs validation workaround of the Allnet in the commit message. As far as I remember some u-boot env variables need to be changed to get it working => document the changes in the commit message.

TO find the reset button pin, have a look at the gpio scripts mentioned in the OpenWrt wiki.

@ghost

This comment has been minimized.

ghost commented Feb 27, 2017

Whats the best way to edit the commit message of the "lantiq: add Allnet ALL0333CJ support" patch 54f5cff ?

I see 3 possibilities, which should all work more or less good:

  1. git pick 54f5cff + git rebase (don't know how to do currently)
  2. git push -f (will delete comments in PR I think)
  3. git revert + git commit with new commit message (will delete comments in PR I think)
@bobafetthotmail

This comment has been minimized.

Contributor

bobafetthotmail commented Feb 27, 2017

I used git reset HEAD~X where X is the number of commits to delete. This will not delete files, only git commits. I delete all commits I made after the commit I need to change.
Then I use git commit --amend to change the commit message of the commit I wanted to change.
Then git add -i to add other modified files to git tracked list with its interface and git commit to make the commit(s) again.
Then git push -f to send the changes over to github and in the PR.

While you are at it, you might want to squash some of your commits in a single one.

Afaik comments here on GIthub are not deleted, they are only tagged as "obsoleted" after the commit they were referring to disappears.
Messages in the PR remain visible.

@mkresin

This comment has been minimized.

Contributor

mkresin commented Feb 27, 2017

Whats the best way to edit the commit message of the "lantiq: add Allnet ALL0333CJ support" patch 54f5cff ?

If it is the last commit then git commit --amend.

Otherwise

git rebase -i HEAD~5

change pick to reword to edit the commit message. change pick to edit to edit the whole commit.

Please squash the new added commits in to the existing ones. You can reorder the commits in that rebase list. Change pick to squash to merge the commit with the commit one line above.

Do a git push --force to overwrite your github branch.

Edit:

Instead of edit, reword and squash, you can use e, r and s. less characters to write.

@mcmilk mcmilk force-pushed the mcmilk:ase branch 4 times, most recently from 9e3eb00 to 59584a9 Feb 28, 2017

@ghost

This comment has been minimized.

ghost commented Feb 28, 2017

@mkresin
git rebase -i HEAD~5 is magic. Thank you, for that hint.

@mcmilk mcmilk force-pushed the mcmilk:ase branch 3 times, most recently from 667dd56 to d0db5de Feb 28, 2017

@ghost

This comment has been minimized.

ghost commented Feb 28, 2017

I have put together the "lantiq: add Allnet ALL0333CJ support" patch and its fixes.

@mcmilk mcmilk force-pushed the mcmilk:ase branch 5 times, most recently from 2b9d063 to 2fbc075 Feb 28, 2017

@mkresin

This comment has been minimized.

Contributor

mkresin commented Apr 25, 2017

@mcmilk Hey Tino, can you give me an update? What does work, what does still not work? Should we merge this PR anyway or would you like to fix the outstanding issues first?

@ghost

This comment has been minimized.

ghost commented Apr 26, 2017

@mkresin Hello Mathias, sorry for the delay, I had overwritten my uboot on the test modem ;)
But I got a Hot Air Gun Rework and an TL866CS Programmer now ... so the work can restart again...

I also bought these adsl modems for 4€ on ebay:

  1. EasyBox 904 xDSL
  2. EasyBox 803 Vodafone

The 803 Box is Danube based and should work out of the box, but it does not sync... I will write more details about this 803 box on the mailing list...

The patch will be reworked (today or tomorrow) and should be okay then.
The modem syncing is maybe another problem. Thats my current state...

mcmilk added some commits Feb 26, 2017

lantiq: fix amazonse.dsti
Add missing memory@0 and localbus@0 sections.
Fix MEI and GPTU interrupt definitions.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>
lantiq: add Amazon-SE subtarget
Re-Add support for the Amazon-SE subtarget on Lantiq.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>
lantiq: enable Netgear DGN1000B image build
Enable the building of Netgear DGN1000B images. I have an
example device here, but it was not tested currently.
Also WLAN and USB is not ready in the moment.

This is just the proper way, so that developing on this
device is known to be done in the near future.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>
lantiq: add Allnet ALL0333CJ support
This patch adds support for the Allnet ADSL2+ Modem ALL0333CJ.

Specifications:
- SoC: Amazon-SE
- RAM: 16MB
- Storage: 4MB NOR FLash
- LEDs: Power, Ethernet, DSL (Sync)
- Buttons: 1x Reset Button (not currently supported, will be done)
- 1x Ethernet-Port: 1x RJ45 10/100BaseTX
- 1x WAN-Port: AnnexB & J, G.992.1(ADSL), G.992.3(ADSL2), G.992.5(ADSL2+)

Installation:
- can be done via telnet+tftp or serial console
- default passwords:
  - via telnet (root:admin)
  - via webinterface http://172.16.1.254:8235/ (admin:coolwhite)

Installation via telnet / tftp:
host: # your own host must have an tftpd daemon, then do this:
host: ifconfig eth0:172 172.16.1.1 up
host: # telnet to allnet modem, root:admin
host: telnet 172.16.1.254
modem: # kill this daemon, it spams your console
modem: killall dsl_cpe_control
modem: # change to some place in ram:
modem: cd /ramdisk/tftp_upload
modem: # load lede-lantiq-ase-ALL0333CJ-squashfs-sysupgrade.bin alias uImage
modem: tftp -g -r uImage 172.16.1.1
modem: # load these extra tools from your tftpd via:
modem: # source: https://github.com/mcmilk/uboot-utils/releases/download/0.1/mips32.tar.gz
modem: tftp -g -r flashwrite 172.16.1.1
modem: tftp -g -r fw_setenv 172.16.1.1
modem: tftp -g -r fw.conf 172.16.1.1
modem: ln -s fw_setenv fw_printenv
modem: chmod +x *
modem: ./fw_setenv disable_recovery y
modem: ./fw_setenv kernel_addr 0xb0010000
modem: ./flashwrite /dev/mtd/1 uImage 0

Installation via serial line at uboot:
uboot: # erase everything exept bootloader
uboot: protect on b0000000 +10000; protect on b03f0000 +10000
uboot: erase all
uboot: # get new firmware via tftp:
uboot: tftpboot 0x80100000 uImage; setenv kernel_addr 0xb0010000
uboot: # copy to flash:
uboot: cp.b 0x80100000 $(kernel_addr) $(filesize)
uboot: # disable proprietary image checking:
uboot: setenv disable_recovery=y; saveenv
uboot: # reboot with LEDE ;)
uboot: reset

Ethernet works as expected, DSL syncronization does not work properly
currently, I am working on this issue.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>
lantiq: fix lantiq_mei.c and amazonse.dsti for adsl modem firmware
The ltq-adsl-mei package is used for 3 lantiq device types:
danube, amazon-se and ar9.

These different SoC's need also different definitions.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>

mcmilk added some commits Feb 28, 2017

lantiq: fix ifxmips_atm_amazon_se.c
Remove 6 defines, which were defined already some lines above.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>
lantiq: fix 0008-MIPS-lantiq-backport-old-timer-code.patch for Amazon-SE
The patch 0008 removes the vanilla kernel gptu.c of lantiq.
But the replacement file timer.c does not work Amazon-SE and
is also protected therefore with an CONFIG_SOC_AMAZON_SE :-)

This commit will re-activate the default vanilla kernel code
in gptu.c for Amazon-SE.

Signed-off-by: Tino Reichardt <milky-lede@mcmilk.de>

@mcmilk mcmilk force-pushed the mcmilk:ase branch from 2fbc075 to 1106dff May 7, 2017

@ghost

This comment has been minimized.

ghost commented May 7, 2017

@mkresin, I have forwarded my own branch to the current master and another commit for fixing gptu things. I didn't resolve the dsl modem issue. AFAIK, danube and amazon-se seem to be broken... but not by my patches, also before :-(

From my side, this patchset is ready for integration into current LEDE.

Open issues: Fix dsl sync, but this will required more time... which I currently do not have...

@ghost

This comment has been minimized.

ghost commented May 26, 2017

Ping

@hauke

This comment has been minimized.

Member

hauke commented Jun 3, 2017

This looks good to me, except for the one change.
@blogic and @mkresin what do you think?

@mkresin

This comment has been minimized.

Contributor

mkresin commented Jun 3, 2017

LGTM

#ifdef CONFIG_AR9
# define LTQ_MEI_INT (INT_NUM_IM1_IRL0 + 23)
# define LTQ_MEI_DYING_GASP_INT (INT_NUM_IM1_IRL0 + 21)
# define LTQ_USB_OC_INT (INT_NUM_IM4_IRL1 + 28)

This comment has been minimized.

@hauke

hauke Jun 3, 2017

Member

This should be:
define LTQ_USB_OC_INT (INT_NUM_IM1_IRL0 + 28)
You used a DMA IRQ number.

This comment has been minimized.

@mcmilk

mcmilk Jun 4, 2017

The #elif defined(CONFIG_SOC_AR9) block on line 1335 was this:
#define IFXMIPS_USB_OC_INT0 (INT_NUM_IM4_IRL1 + 28)

... I just moved it upwards to get rid of the lot #ifdef's there ... it made sense, to move them onto top ;-)

@hauke

This comment has been minimized.

Member

hauke commented Jun 3, 2017

Thank you for the pull request, I merged it with some small changes.

@hauke hauke closed this Jun 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment