aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>2018-08-10 05:51:13 -0400
committerStephen Boyd <sboyd@kernel.org>2018-10-16 17:41:53 -0400
commit5ddf0cdf9395b0f58ec863cefd497626c9ff0ad8 (patch)
tree240853e25daa0f6120d076687816bf4b011596a4
parentc4dd4a2eb6b99f06cf395e22ac8326cf54bd4e07 (diff)
clk: actions: Add Actions Semi S900 SoC Reset Management Unit support
Add Reset Management Unit (RMU) support for Actions Semi S900 SoC. Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
-rw-r--r--drivers/clk/actions/owl-s900.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/drivers/clk/actions/owl-s900.c b/drivers/clk/actions/owl-s900.c
index bb7ee872d316..790890978424 100644
--- a/drivers/clk/actions/owl-s900.c
+++ b/drivers/clk/actions/owl-s900.c
@@ -19,8 +19,10 @@
19#include "owl-gate.h" 19#include "owl-gate.h"
20#include "owl-mux.h" 20#include "owl-mux.h"
21#include "owl-pll.h" 21#include "owl-pll.h"
22#include "owl-reset.h"
22 23
23#include <dt-bindings/clock/actions,s900-cmu.h> 24#include <dt-bindings/clock/actions,s900-cmu.h>
25#include <dt-bindings/reset/actions,s900-reset.h>
24 26
25#define CMU_COREPLL (0x0000) 27#define CMU_COREPLL (0x0000)
26#define CMU_DEVPLL (0x0004) 28#define CMU_DEVPLL (0x0004)
@@ -684,20 +686,100 @@ static struct clk_hw_onecell_data s900_hw_clks = {
684 .num = CLK_NR_CLKS, 686 .num = CLK_NR_CLKS,
685}; 687};
686 688
689static const struct owl_reset_map s900_resets[] = {
690 [RESET_DMAC] = { CMU_DEVRST0, BIT(0) },
691 [RESET_SRAMI] = { CMU_DEVRST0, BIT(1) },
692 [RESET_DDR_CTL_PHY] = { CMU_DEVRST0, BIT(2) },
693 [RESET_NANDC0] = { CMU_DEVRST0, BIT(3) },
694 [RESET_SD0] = { CMU_DEVRST0, BIT(4) },
695 [RESET_SD1] = { CMU_DEVRST0, BIT(5) },
696 [RESET_PCM1] = { CMU_DEVRST0, BIT(6) },
697 [RESET_DE] = { CMU_DEVRST0, BIT(7) },
698 [RESET_LVDS] = { CMU_DEVRST0, BIT(8) },
699 [RESET_SD2] = { CMU_DEVRST0, BIT(9) },
700 [RESET_DSI] = { CMU_DEVRST0, BIT(10) },
701 [RESET_CSI0] = { CMU_DEVRST0, BIT(11) },
702 [RESET_BISP_AXI] = { CMU_DEVRST0, BIT(12) },
703 [RESET_CSI1] = { CMU_DEVRST0, BIT(13) },
704 [RESET_GPIO] = { CMU_DEVRST0, BIT(15) },
705 [RESET_EDP] = { CMU_DEVRST0, BIT(16) },
706 [RESET_AUDIO] = { CMU_DEVRST0, BIT(17) },
707 [RESET_PCM0] = { CMU_DEVRST0, BIT(18) },
708 [RESET_HDE] = { CMU_DEVRST0, BIT(21) },
709 [RESET_GPU3D_PA] = { CMU_DEVRST0, BIT(22) },
710 [RESET_IMX] = { CMU_DEVRST0, BIT(23) },
711 [RESET_SE] = { CMU_DEVRST0, BIT(24) },
712 [RESET_NANDC1] = { CMU_DEVRST0, BIT(25) },
713 [RESET_SD3] = { CMU_DEVRST0, BIT(26) },
714 [RESET_GIC] = { CMU_DEVRST0, BIT(27) },
715 [RESET_GPU3D_PB] = { CMU_DEVRST0, BIT(28) },
716 [RESET_DDR_CTL_PHY_AXI] = { CMU_DEVRST0, BIT(29) },
717 [RESET_CMU_DDR] = { CMU_DEVRST0, BIT(30) },
718 [RESET_DMM] = { CMU_DEVRST0, BIT(31) },
719 [RESET_USB2HUB] = { CMU_DEVRST1, BIT(0) },
720 [RESET_USB2HSIC] = { CMU_DEVRST1, BIT(1) },
721 [RESET_HDMI] = { CMU_DEVRST1, BIT(2) },
722 [RESET_HDCP2TX] = { CMU_DEVRST1, BIT(3) },
723 [RESET_UART6] = { CMU_DEVRST1, BIT(4) },
724 [RESET_UART0] = { CMU_DEVRST1, BIT(5) },
725 [RESET_UART1] = { CMU_DEVRST1, BIT(6) },
726 [RESET_UART2] = { CMU_DEVRST1, BIT(7) },
727 [RESET_SPI0] = { CMU_DEVRST1, BIT(8) },
728 [RESET_SPI1] = { CMU_DEVRST1, BIT(9) },
729 [RESET_SPI2] = { CMU_DEVRST1, BIT(10) },
730 [RESET_SPI3] = { CMU_DEVRST1, BIT(11) },
731 [RESET_I2C0] = { CMU_DEVRST1, BIT(12) },
732 [RESET_I2C1] = { CMU_DEVRST1, BIT(13) },
733 [RESET_USB3] = { CMU_DEVRST1, BIT(14) },
734 [RESET_UART3] = { CMU_DEVRST1, BIT(15) },
735 [RESET_UART4] = { CMU_DEVRST1, BIT(16) },
736 [RESET_UART5] = { CMU_DEVRST1, BIT(17) },
737 [RESET_I2C2] = { CMU_DEVRST1, BIT(18) },
738 [RESET_I2C3] = { CMU_DEVRST1, BIT(19) },
739 [RESET_ETHERNET] = { CMU_DEVRST1, BIT(20) },
740 [RESET_CHIPID] = { CMU_DEVRST1, BIT(21) },
741 [RESET_I2C4] = { CMU_DEVRST1, BIT(22) },
742 [RESET_I2C5] = { CMU_DEVRST1, BIT(23) },
743 [RESET_CPU_SCNT] = { CMU_DEVRST1, BIT(30) }
744};
745
687static struct owl_clk_desc s900_clk_desc = { 746static struct owl_clk_desc s900_clk_desc = {
688 .clks = s900_clks, 747 .clks = s900_clks,
689 .num_clks = ARRAY_SIZE(s900_clks), 748 .num_clks = ARRAY_SIZE(s900_clks),
690 749
691 .hw_clks = &s900_hw_clks, 750 .hw_clks = &s900_hw_clks,
751
752 .resets = s900_resets,
753 .num_resets = ARRAY_SIZE(s900_resets),
692}; 754};
693 755
694static int s900_clk_probe(struct platform_device *pdev) 756static int s900_clk_probe(struct platform_device *pdev)
695{ 757{
696 struct owl_clk_desc *desc; 758 struct owl_clk_desc *desc;
759 struct owl_reset *reset;
760 int ret;
697 761
698 desc = &s900_clk_desc; 762 desc = &s900_clk_desc;
699 owl_clk_regmap_init(pdev, desc); 763 owl_clk_regmap_init(pdev, desc);
700 764
765 /*
766 * FIXME: Reset controller registration should be moved to
767 * common code, once all SoCs of Owl family supports it.
768 */
769 reset = devm_kzalloc(&pdev->dev, sizeof(*reset), GFP_KERNEL);
770 if (!reset)
771 return -ENOMEM;
772
773 reset->rcdev.of_node = pdev->dev.of_node;
774 reset->rcdev.ops = &owl_reset_ops;
775 reset->rcdev.nr_resets = desc->num_resets;
776 reset->reset_map = desc->resets;
777 reset->regmap = desc->regmap;
778
779 ret = devm_reset_controller_register(&pdev->dev, &reset->rcdev);
780 if (ret)
781 dev_err(&pdev->dev, "Failed to register reset controller\n");
782
701 return owl_clk_probe(&pdev->dev, desc->hw_clks); 783 return owl_clk_probe(&pdev->dev, desc->hw_clks);
702} 784}
703 785