common.c (80da549e5225c6f80d45f76ba2b3a4574ed278ae) | common.c (5b03df9ace680d7cdd34a69dfd85ca5f74159d18) |
---|---|
1/* 2 * arch/arm/mach-dove/common.c 3 * 4 * Core functions for Marvell Dove 88AP510 System On Chip 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 */ 10 11#include <linux/kernel.h> 12#include <linux/delay.h> 13#include <linux/init.h> 14#include <linux/platform_device.h> 15#include <linux/pci.h> 16#include <linux/clk-provider.h> | 1/* 2 * arch/arm/mach-dove/common.c 3 * 4 * Core functions for Marvell Dove 88AP510 System On Chip 5 * 6 * This file is licensed under the terms of the GNU General Public 7 * License version 2. This program is licensed "as is" without any 8 * warranty of any kind, whether express or implied. 9 */ 10 11#include <linux/kernel.h> 12#include <linux/delay.h> 13#include <linux/init.h> 14#include <linux/platform_device.h> 15#include <linux/pci.h> 16#include <linux/clk-provider.h> |
17#include <linux/clk/mvebu.h> |
|
17#include <linux/ata_platform.h> 18#include <linux/gpio.h> 19#include <linux/of.h> 20#include <linux/of_platform.h> 21#include <asm/page.h> 22#include <asm/setup.h> 23#include <asm/timex.h> 24#include <asm/hardware/cache-tauros2.h> --- 346 unchanged lines hidden (view full) --- 371 writel(SOFT_RESET, SYSTEM_SOFT_RESET); 372 373 while (1) 374 ; 375} 376 377#if defined(CONFIG_MACH_DOVE_DT) 378/* | 18#include <linux/ata_platform.h> 19#include <linux/gpio.h> 20#include <linux/of.h> 21#include <linux/of_platform.h> 22#include <asm/page.h> 23#include <asm/setup.h> 24#include <asm/timex.h> 25#include <asm/hardware/cache-tauros2.h> --- 346 unchanged lines hidden (view full) --- 372 writel(SOFT_RESET, SYSTEM_SOFT_RESET); 373 374 while (1) 375 ; 376} 377 378#if defined(CONFIG_MACH_DOVE_DT) 379/* |
379 * Auxdata required until real OF clock provider | 380 * There are still devices that doesn't even know about DT, 381 * get clock gates here and add a clock lookup. |
380 */ | 382 */ |
381struct of_dev_auxdata dove_auxdata_lookup[] __initdata = { 382 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), 383 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1014600, "orion_spi.1", NULL), 384 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 385 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", 386 NULL), 387 OF_DEV_AUXDATA("marvell,orion-sata", 0xf10a0000, "sata_mv.0", NULL), 388 OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1092000, "sdhci-dove.0", NULL), 389 OF_DEV_AUXDATA("marvell,dove-sdhci", 0xf1090000, "sdhci-dove.1", NULL), 390 {}, 391}; | 383static void __init dove_legacy_clk_init(void) 384{ 385 struct device_node *np = of_find_compatible_node(NULL, NULL, 386 "marvell,dove-gating-clock"); 387 struct of_phandle_args clkspec; |
392 | 388 |
389 clkspec.np = np; 390 clkspec.args_count = 1; 391 392 clkspec.args[0] = CLOCK_GATING_BIT_USB0; 393 orion_clkdev_add(NULL, "orion-ehci.0", 394 of_clk_get_from_provider(&clkspec)); 395 396 clkspec.args[0] = CLOCK_GATING_BIT_USB1; 397 orion_clkdev_add(NULL, "orion-ehci.1", 398 of_clk_get_from_provider(&clkspec)); 399 400 clkspec.args[0] = CLOCK_GATING_BIT_GBE; 401 orion_clkdev_add(NULL, "mv643xx_eth_port.0", 402 of_clk_get_from_provider(&clkspec)); 403 404 clkspec.args[0] = CLOCK_GATING_BIT_PCIE0; 405 orion_clkdev_add("0", "pcie", 406 of_clk_get_from_provider(&clkspec)); 407 408 clkspec.args[0] = CLOCK_GATING_BIT_PCIE1; 409 orion_clkdev_add("1", "pcie", 410 of_clk_get_from_provider(&clkspec)); 411 412 clkspec.args[0] = CLOCK_GATING_BIT_XOR0; 413 orion_clkdev_add(NULL, "mv_xor_shared.0", 414 of_clk_get_from_provider(&clkspec)); 415 416 clkspec.args[0] = CLOCK_GATING_BIT_XOR1; 417 orion_clkdev_add(NULL, "mv_xor_shared.1", 418 of_clk_get_from_provider(&clkspec)); 419} 420 421static void __init dove_of_clk_init(void) 422{ 423 mvebu_clocks_init(); 424 dove_legacy_clk_init(); 425} 426 |
|
393static struct mv643xx_eth_platform_data dove_dt_ge00_data = { 394 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, 395}; 396 397static void __init dove_dt_init(void) 398{ 399 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n", 400 (dove_tclk + 499999) / 1000000); 401 402#ifdef CONFIG_CACHE_TAUROS2 403 tauros2_init(0); 404#endif 405 dove_setup_cpu_mbus(); 406 407 /* Setup root of clk tree */ | 427static struct mv643xx_eth_platform_data dove_dt_ge00_data = { 428 .phy_addr = MV643XX_ETH_PHY_ADDR_DEFAULT, 429}; 430 431static void __init dove_dt_init(void) 432{ 433 pr_info("Dove 88AP510 SoC, TCLK = %d MHz.\n", 434 (dove_tclk + 499999) / 1000000); 435 436#ifdef CONFIG_CACHE_TAUROS2 437 tauros2_init(0); 438#endif 439 dove_setup_cpu_mbus(); 440 441 /* Setup root of clk tree */ |
408 dove_clk_init(); | 442 dove_of_clk_init(); |
409 410 /* Internal devices not ported to DT yet */ 411 dove_rtc_init(); 412 dove_xor0_init(); 413 dove_xor1_init(); 414 415 dove_ge00_init(&dove_dt_ge00_data); 416 dove_ehci0_init(); 417 dove_ehci1_init(); 418 dove_pcie_init(1, 1); 419 | 443 444 /* Internal devices not ported to DT yet */ 445 dove_rtc_init(); 446 dove_xor0_init(); 447 dove_xor1_init(); 448 449 dove_ge00_init(&dove_dt_ge00_data); 450 dove_ehci0_init(); 451 dove_ehci1_init(); 452 dove_pcie_init(1, 1); 453 |
420 of_platform_populate(NULL, of_default_bus_match_table, 421 dove_auxdata_lookup, NULL); | 454 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
422} 423 424static const char * const dove_dt_board_compat[] = { 425 "marvell,dove", 426 NULL 427}; 428 429DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") 430 .map_io = dove_map_io, 431 .init_early = dove_init_early, 432 .init_irq = orion_dt_init_irq, 433 .timer = &dove_timer, 434 .init_machine = dove_dt_init, 435 .restart = dove_restart, 436 .dt_compat = dove_dt_board_compat, 437MACHINE_END 438#endif | 455} 456 457static const char * const dove_dt_board_compat[] = { 458 "marvell,dove", 459 NULL 460}; 461 462DT_MACHINE_START(DOVE_DT, "Marvell Dove (Flattened Device Tree)") 463 .map_io = dove_map_io, 464 .init_early = dove_init_early, 465 .init_irq = orion_dt_init_irq, 466 .timer = &dove_timer, 467 .init_machine = dove_dt_init, 468 .restart = dove_restart, 469 .dt_compat = dove_dt_board_compat, 470MACHINE_END 471#endif |