board_bcm.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (C) 2012 Broadcom Corporation
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation version 2.
  7. *
  8. * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  9. * kind, whether express or implied; without even the implied warranty
  10. * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #include <linux/of_platform.h>
  14. #include <linux/init.h>
  15. #include <linux/device.h>
  16. #include <linux/platform_device.h>
  17. #include <linux/clocksource.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/time.h>
  20. #include <asm/hardware/cache-l2x0.h>
  21. #include "bcm_kona_smc.h"
  22. static int __init kona_l2_cache_init(void)
  23. {
  24. if (!IS_ENABLED(CONFIG_CACHE_L2X0))
  25. return 0;
  26. bcm_kona_smc(SSAPI_ENABLE_L2_CACHE, 0, 0, 0, 0);
  27. /*
  28. * The aux_val and aux_mask have no effect since L2 cache is already
  29. * enabled. Pass 0s for aux_val and 1s for aux_mask for default value.
  30. */
  31. l2x0_of_init(0, ~0);
  32. return 0;
  33. }
  34. static void __init board_init(void)
  35. {
  36. of_platform_populate(NULL, of_default_bus_match_table, NULL,
  37. &platform_bus);
  38. bcm_kona_smc_init();
  39. kona_l2_cache_init();
  40. }
  41. static const char * const bcm11351_dt_compat[] = { "bcm,bcm11351", NULL, };
  42. DT_MACHINE_START(BCM11351_DT, "Broadcom Application Processor")
  43. .init_time = clocksource_of_init,
  44. .init_machine = board_init,
  45. .dt_compat = bcm11351_dt_compat,
  46. MACHINE_END