1 // SPDX-License-Identifier: GPL-2.0+
3 * Keystone EVM : Board initialization
6 * Texas Instruments Incorporated, <www.ti.com>
11 #include <asm/arch/psc_defs.h>
12 #include <asm/arch/hardware.h>
15 * cpu_to_bus - swap bytes of the 32-bit data if the device is BE
16 * @ptr - array of data
17 * @length - lenght of data array
19 int cpu_to_bus(u32 *ptr, u32 length)
23 if (!(readl(KS2_DEVSTAT) & 0x1))
24 for (i = 0; i < length; i++, ptr++)
25 *ptr = cpu_to_be32(*ptr);
30 static void turn_off_all_dsps(int num_dsps)
34 for (i = 0; i < num_dsps; i++) {
35 if (psc_disable_module(i + KS2_LPSC_GEM_0))
36 printf("Cannot disable module for #%d DSP", i);
38 if (psc_disable_domain(i + KS2_GEM_0_PWR_DOMAIN))
39 printf("Cannot disable domain for #%d DSP", i);
48 env = env_get("ks2_debug");
51 ks2_debug = simple_strtol(env, NULL, 0);
53 if ((ks2_debug & DBG_LEAVE_DSPS_ON) == 0)
54 turn_off_all_dsps(KS2_NUM_DSPS);