Skip to content
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

add a configurable i2c address to an RTC? #2611

Closed
shawaj opened this issue Jul 9, 2018 · 12 comments
Closed

add a configurable i2c address to an RTC? #2611

shawaj opened this issue Jul 9, 2018 · 12 comments

Comments

@shawaj
Copy link

shawaj commented Jul 9, 2018

On PiJuice (https://github.com/PiSupply/PiJuice) we are using an emulated ds1339 RTC running on the STM32 MCU.

However, to avoid hardware clashes we are offering the possibility for users to change the i2c address of the RTC.

We would like to add support for changing of the address using the overlay. Would this be acceptable if we submitted a PR?

See this issue for further discussion also - PiSupply/PiJuice#166 (comment)

Thanks

@pelwell
Copy link
Contributor

pelwell commented Jul 9, 2018

Would this be acceptable if we submitted a PR?

Go for it.

@shawaj
Copy link
Author

shawaj commented Jul 9, 2018

Cool...will sort something and then post back here

@pelwell
Copy link
Contributor

pelwell commented Jul 9, 2018

A PR would be better.

@tvoverbeek
Copy link

See PiSupply/PiJuice#166 comment by @hemingchen for a work-around using new_device in /sys/bus/i2c/devices/i2c-1.
Suppose you have the emulated ds1339 RTC at 0x65.
Then echo ds1339 0x65 | sudo tee /sys/bus/i2c/devices/i2c-1/new_device will load the rtc_ds1307 module and e.g. sudo hwclock -r works.
But something like the i2c-rtc overlay with an added address parameter override is preferable.

pelwell pushed a commit that referenced this issue Jul 9, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
@pelwell
Copy link
Contributor

pelwell commented Jul 9, 2018

See 1fa2579.

@tvoverbeek
Copy link

@pelwell Thanks for the quick implementaton.
How long does it take before this change shows up in rpi-update?
Days, Weeks? Thanks in advance.

@pelwell
Copy link
Contributor

pelwell commented Jul 10, 2018

It varies from hours to days, but is rarely longer than a week. In the meantime you can build your own:

  1. Download the source file: https://raw.githubusercontent.com/raspberrypi/linux/1fa25792a2e83012e91de333034b9c9033adc1c3/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
  2. Compile it:
    dtc -@ -I dts -O dtb -o i2c-rtc.dtbo i2c-rtc-overlay.dts
    
    Don't worry about any warnings - the dtc utility isn't very overlay-aware.
  3. Install it:
    sudo cp i2c-rtc.dtbo /boot/overlays
    

@tvoverbeek
Copy link

@pelwell Thanks again. Just tried the build and it works as expected.
Will keep an eye on raspberrypi/linux/firmware to see when it shows up.

popcornmix added a commit to Hexxeh/rpi-firmware that referenced this issue Jul 11, 2018
See: raspberrypi/linux#2614

kernel: vc4: DPI support
See: raspberrypi/linux#2429

kernel: spi: Make GPIO CSs honour the SPI_NO_CS flag
See: raspberrypi/linux#2169

kernel: overlays: Add addr parameter to i2c-rtc (& -gpio)
See: raspberrypi/linux#2611

userland: mmal: Remove unused mmal_metadata header file
popcornmix added a commit to raspberrypi/firmware that referenced this issue Jul 11, 2018
See: raspberrypi/linux#2614

kernel: vc4: DPI support
See: raspberrypi/linux#2429

kernel: spi: Make GPIO CSs honour the SPI_NO_CS flag
See: raspberrypi/linux#2169

kernel: overlays: Add addr parameter to i2c-rtc (& -gpio)
See: raspberrypi/linux#2611

userland: mmal: Remove unused mmal_metadata header file
@pelwell
Copy link
Contributor

pelwell commented Jul 12, 2018

Last night's firmware release includes the patched i2c-rtc (and i2c-rtc-gpio) overlay(s).

@tvoverbeek
Copy link

@pelwell Thanks Phil for the heads-up

@shawaj
Copy link
Author

shawaj commented Jul 12, 2018

Thanks @pelwell @tvoverbeek

@pelwell
Copy link
Contributor

pelwell commented Jul 18, 2018

@shawaj Please close if you feel the issue has been resolved.

@shawaj shawaj closed this as completed Jul 18, 2018
pelwell pushed a commit to pelwell/linux that referenced this issue Nov 13, 2018
See: raspberrypi#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
pelwell pushed a commit to pelwell/linux that referenced this issue Nov 13, 2018
See: raspberrypi#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
pelwell pushed a commit to pelwell/linux that referenced this issue Nov 13, 2018
See: raspberrypi#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
pelwell pushed a commit to pelwell/linux that referenced this issue Nov 13, 2018
See: raspberrypi#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
pelwell pushed a commit that referenced this issue Nov 13, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 13, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 15, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 19, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 21, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 23, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 28, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Nov 28, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
lyakh pushed a commit to lyakh/linux that referenced this issue Nov 30, 2018
See: raspberrypi/linux#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 4, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 14, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 17, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 17, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 21, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Dec 24, 2018
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Jan 1, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
lyakh pushed a commit to lyakh/linux that referenced this issue Jan 7, 2019
See: raspberrypi/linux#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Jan 9, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Jan 14, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Jan 22, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Jan 23, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
lyakh pushed a commit to lyakh/linux that referenced this issue Jan 24, 2019
See: raspberrypi/linux#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Feb 4, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Feb 12, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Feb 18, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Feb 24, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Mar 6, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Mar 12, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Mar 15, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Mar 21, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Apr 2, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Apr 8, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Gadgetoid pushed a commit to Gadgetoid/linux that referenced this issue Apr 10, 2019
See: raspberrypi#2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Apr 23, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Apr 30, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue Apr 30, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue May 7, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix pushed a commit that referenced this issue May 13, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
TiejunChina pushed a commit that referenced this issue Jun 19, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
TiejunChina pushed a commit that referenced this issue Jul 23, 2019
See: #2611

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants