Skip to content

Commit

Permalink
Merge tag 'rtc-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/abelloni/linux

Pull RTC updates from Alexandre Belloni:
 "New drivers:
   - Amlogic A4 and A5 RTC
   - Marvell 88PM886 PMIC RTC
   - Renesas RTCA-3 for Renesas RZ/G3S

  Driver updates:
   - ab-eoz9: fix temperature and alarm support
   - cmos: improve locking behaviour
   - isl12022: add alarm support
   - m48t59: improve epoch handling
   - mt6359: add range
   - rzn1: fix BCD conversions and simplify driver"

* tag 'rtc-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (38 commits)
  rtc: ab-eoz9: don't fail temperature reads on undervoltage notification
  rtc: rzn1: reduce register access
  rtc: rzn1: drop superfluous wday calculation
  m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver
  rtc: brcmstb-waketimer: don't include 'pm_wakeup.h' directly
  rtc: m48t59: Use platform_data struct for year offset value
  rtc: ab-eoz9: fix abeoz9_rtc_read_alarm
  rtc: rv3028: fix RV3028_TS_COUNT type
  rtc: rzn1: update Michel's email
  rtc: rzn1: fix BCD to rtc_time conversion errors
  rtc: amlogic-a4: fix compile error
  rtc: amlogic-a4: drop error messages
  MAINTAINERS: Add an entry for Amlogic RTC driver
  rtc: support for the Amlogic on-chip RTC
  dt-bindings: rtc: Add Amlogic A4 and A5 RTC
  rtc: add driver for Marvell 88PM886 PMIC RTC
  rtc: check if __rtc_read_time was successful in rtc_timer_do_work()
  rtc: pcf8563: Switch to regmap
  rtc: pcf8563: Sort headers alphabetically
  rtc: abx80x: Fix WDT bit position of the status register
  ...
  • Loading branch information
Linus Torvalds committed Nov 30, 2024
2 parents 831c192 + e0779a0 commit 0e287d3
Show file tree
Hide file tree
Showing 81 changed files with 2,221 additions and 599 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ properties:
- const: allwinner,sun50i-a64-rtc
- const: allwinner,sun8i-h3-rtc
- items:
- const: allwinner,sun20i-d1-rtc
- enum:
- allwinner,sun20i-d1-rtc
- allwinner,sun55i-a523-rtc
- const: allwinner,sun50i-r329-rtc

reg:
Expand Down
63 changes: 63 additions & 0 deletions Documentation/devicetree/bindings/rtc/amlogic,a4-rtc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
# Copyright (C) 2024 Amlogic, Inc. All rights reserved
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/amlogic,a4-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Amlogic A4 and A5 RTC

maintainers:
- Yiting Deng <yiting.deng@amlogic.com>
- Xianwei Zhao <xianwei.zhao@amlogic.com>

allOf:
- $ref: rtc.yaml#

properties:
compatible:
enum:
- amlogic,a4-rtc
- amlogic,a5-rtc

reg:
maxItems: 1

clocks:
items:
- description: RTC clock source, available 24M or 32K crystal
oscillator source. when using 24M, need to divide 24M into 32K.
- description: RTC module accesses the clock of the apb bus.

clock-names:
items:
- const: osc
- const: sys

interrupts:
maxItems: 1

required:
- compatible
- reg
- clocks
- clock-names
- interrupts

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
apb {
#address-cells = <2>;
#size-cells = <2>;
rtc@8e600 {
compatible = "amlogic,a4-rtc";
reg = <0x0 0x8e600 0x0 0x38>;
clocks = <&xtal_32k>, <&clkc_periphs 1>;
clock-names = "osc", "sys";
interrupts = <GIC_SPI 131 IRQ_TYPE_EDGE_RISING>;
};
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/microchip,mfps-rtc.yaml#
$id: http://devicetree.org/schemas/rtc/microchip,mpfs-rtc.yaml#

$schema: http://devicetree.org/meta-schemas/core.yaml#

Expand All @@ -12,12 +12,14 @@ allOf:

maintainers:
- Daire McNamara <daire.mcnamara@microchip.com>
- Lewis Hanly <lewis.hanly@microchip.com>

properties:
compatible:
enum:
- microchip,mpfs-rtc
oneOf:
- items:
- const: microchip,pic64gx-rtc
- const: microchip,mpfs-rtc
- const: microchip,mpfs-rtc

reg:
maxItems: 1
Expand Down
84 changes: 84 additions & 0 deletions Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/renesas,rz-rtca3.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Renesas RTCA-3 Real Time Clock

maintainers:
- Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

allOf:
- $ref: rtc.yaml#

properties:
compatible:
items:
- enum:
- renesas,r9a08g045-rtca3 # RZ/G3S
- const: renesas,rz-rtca3

reg:
maxItems: 1

interrupts:
items:
- description: Alarm interrupt
- description: Periodic interrupt
- description: Carry interrupt

interrupt-names:
items:
- const: alarm
- const: period
- const: carry

clocks:
items:
- description: RTC bus clock
- description: RTC counter clock

clock-names:
items:
- const: bus
- const: counter

power-domains:
maxItems: 1

resets:
items:
- description: VBATTB module reset

required:
- compatible
- reg
- interrupts
- interrupt-names
- clocks
- clock-names
- power-domains
- resets

additionalProperties: false

examples:
- |
#include <dt-bindings/clock/r9a08g045-cpg.h>
#include <dt-bindings/clock/renesas,r9a08g045-vbattb.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
rtc@1004ec00 {
compatible = "renesas,r9a08g045-rtca3", "renesas,rz-rtca3";
reg = <0x1004ec00 0x400>;
interrupts = <GIC_SPI 315 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 316 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 317 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "alarm", "period", "carry";
clocks = <&cpg CPG_MOD R9A08G045_VBAT_BCLK>, <&vbattclk VBATTB_VBATTCLK>;
clock-names = "bus", "counter";
power-domains = <&cpg>;
resets = <&cpg R9A08G045_VBAT_BRESETN>;
};
17 changes: 17 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,14 @@ F: Documentation/devicetree/bindings/perf/amlogic,g12-ddr-pmu.yaml
F: drivers/perf/amlogic/
F: include/soc/amlogic/

AMLOGIC RTC DRIVER
M: Yiting Deng <yiting.deng@amlogic.com>
M: Xianwei Zhao <xianwei.zhao@amlogic.com>
L: linux-amlogic@lists.infradead.org
S: Maintained
F: Documentation/devicetree/bindings/rtc/amlogic,a4-rtc.yaml
F: drivers/rtc/rtc-amlogic-a4.c

AMPHENOL CHIPCAP 2 HUMIDITY-TEMPERATURE IIO DRIVER
M: Javier Carrasco <javier.carrasco.cruz@gmail.com>
L: linux-hwmon@vger.kernel.org
Expand Down Expand Up @@ -13794,6 +13802,7 @@ F: Documentation/devicetree/bindings/mfd/marvell,88pm886-a1.yaml
F: drivers/input/misc/88pm886-onkey.c
F: drivers/mfd/88pm886.c
F: drivers/regulator/88pm886-regulator.c
F: drivers/rtc/rtc-88pm886.c
F: include/linux/mfd/88pm886.h

MARVELL ARMADA 3700 PHY DRIVERS
Expand Down Expand Up @@ -19915,6 +19924,14 @@ S: Supported
F: Documentation/devicetree/bindings/timer/renesas,rz-mtu3.yaml
F: drivers/counter/rz-mtu3-cnt.c

RENESAS RTCA-3 RTC DRIVER
M: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
L: linux-rtc@vger.kernel.org
L: linux-renesas-soc@vger.kernel.org
S: Supported
F: Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
F: drivers/rtc/rtc-renesas-rtca3.c

RENESAS RZ/N1 A5PSW SWITCH DRIVER
M: Clément Léger <clement.leger@bootlin.com>
L: linux-renesas-soc@vger.kernel.org
Expand Down
1 change: 1 addition & 0 deletions arch/m68k/configs/multi_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ CONFIG_UHID=m
# CONFIG_USB_SUPPORT is not set
CONFIG_RTC_CLASS=y
# CONFIG_RTC_NVMEM is not set
CONFIG_RTC_DRV_M48T59=m
CONFIG_RTC_DRV_MSM6242=m
CONFIG_RTC_DRV_RP5C01=m
CONFIG_RTC_DRV_GENERIC=m
Expand Down
1 change: 1 addition & 0 deletions arch/m68k/configs/mvme147_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ CONFIG_UHID=m
# CONFIG_USB_SUPPORT is not set
CONFIG_RTC_CLASS=y
# CONFIG_RTC_NVMEM is not set
CONFIG_RTC_DRV_M48T59=y
CONFIG_RTC_DRV_GENERIC=m
# CONFIG_VIRTIO_MENU is not set
# CONFIG_VHOST_MENU is not set
Expand Down
1 change: 1 addition & 0 deletions arch/m68k/configs/mvme16x_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ CONFIG_UHID=m
# CONFIG_USB_SUPPORT is not set
CONFIG_RTC_CLASS=y
# CONFIG_RTC_NVMEM is not set
CONFIG_RTC_DRV_M48T59=y
CONFIG_RTC_DRV_GENERIC=m
# CONFIG_VIRTIO_MENU is not set
# CONFIG_VHOST_MENU is not set
Expand Down
19 changes: 1 addition & 18 deletions arch/m68k/include/asm/mvme147hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,7 @@

#include <asm/irq.h>

typedef struct {
unsigned char
ctrl,
bcd_sec,
bcd_min,
bcd_hr,
bcd_dow,
bcd_dom,
bcd_mth,
bcd_year;
} MK48T02;

#define RTC_WRITE 0x80
#define RTC_READ 0x40
#define RTC_STOP 0x20

#define m147_rtc ((MK48T02 * volatile)0xfffe07f8)

#define MVME147_RTC_BASE 0xfffe0000

struct pcc_regs {
volatile u_long dma_tadr;
Expand Down
18 changes: 1 addition & 17 deletions arch/m68k/include/asm/mvme16xhw.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,7 @@ typedef struct {

#define mvmelp ((*(volatile MVMElpPtr)(MVME_LPR_BASE)))

typedef struct {
unsigned char
ctrl,
bcd_sec,
bcd_min,
bcd_hr,
bcd_dow,
bcd_dom,
bcd_mth,
bcd_year;
} MK48T08_t, *MK48T08ptr_t;

#define RTC_WRITE 0x80
#define RTC_READ 0x40
#define RTC_STOP 0x20

#define MVME_RTC_BASE 0xfffc1ff8
#define MVME_RTC_BASE 0xfffc0000

#define MVME_I596_BASE 0xfff46000

Expand Down
55 changes: 24 additions & 31 deletions arch/m68k/mvme147/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
#include <linux/linkage.h>
#include <linux/init.h>
#include <linux/major.h>
#include <linux/rtc.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/rtc/m48t59.h>

#include <asm/bootinfo.h>
#include <asm/bootinfo-vme.h>
Expand All @@ -36,13 +37,9 @@

static void mvme147_get_model(char *model);
static void __init mvme147_sched_init(void);
extern int mvme147_hwclk (int, struct rtc_time *);
extern void mvme147_reset (void);


static int bcd2int (unsigned char b);


int __init mvme147_parse_bootinfo(const struct bi_record *bi)
{
uint16_t tag = be16_to_cpu(bi->tag);
Expand Down Expand Up @@ -80,7 +77,6 @@ void __init config_mvme147(void)
{
mach_sched_init = mvme147_sched_init;
mach_init_IRQ = mvme147_init_IRQ;
mach_hwclk = mvme147_hwclk;
mach_reset = mvme147_reset;
mach_get_model = mvme147_get_model;

Expand All @@ -89,6 +85,28 @@ void __init config_mvme147(void)
vme_brdtype = VME_TYPE_MVME147;
}

static struct resource m48t59_rsrc[] = {
DEFINE_RES_MEM(MVME147_RTC_BASE, 0x800),
};

static struct m48t59_plat_data m48t59_data = {
.type = M48T59RTC_TYPE_M48T02,
.yy_offset = 70,
};

static int __init mvme147_platform_init(void)
{
if (!MACH_IS_MVME147)
return 0;

platform_device_register_resndata(NULL, "rtc-m48t59", -1,
m48t59_rsrc, ARRAY_SIZE(m48t59_rsrc),
&m48t59_data, sizeof(m48t59_data));
return 0;
}

arch_initcall(mvme147_platform_init);

static u64 mvme147_read_clk(struct clocksource *cs);

static struct clocksource mvme147_clk = {
Expand Down Expand Up @@ -162,31 +180,6 @@ static u64 mvme147_read_clk(struct clocksource *cs)
return ticks;
}

static int bcd2int (unsigned char b)
{
return ((b>>4)*10 + (b&15));
}

int mvme147_hwclk(int op, struct rtc_time *t)
{
if (!op) {
m147_rtc->ctrl = RTC_READ;
t->tm_year = bcd2int (m147_rtc->bcd_year);
t->tm_mon = bcd2int(m147_rtc->bcd_mth) - 1;
t->tm_mday = bcd2int (m147_rtc->bcd_dom);
t->tm_hour = bcd2int (m147_rtc->bcd_hr);
t->tm_min = bcd2int (m147_rtc->bcd_min);
t->tm_sec = bcd2int (m147_rtc->bcd_sec);
m147_rtc->ctrl = 0;
if (t->tm_year < 70)
t->tm_year += 100;
} else {
/* FIXME Setting the time is not yet supported */
return -EOPNOTSUPP;
}
return 0;
}

static void scc_delay(void)
{
__asm__ __volatile__ ("nop; nop;");
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/mvme16x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Makefile for Linux arch/m68k/mvme16x source directory
#

obj-y := config.o rtc.o
obj-y := config.o
Loading

0 comments on commit 0e287d3

Please sign in to comment.