#!/bin/sh

val=$1
if [ $val -eq 2 ]
then

	#echo Configure for Dynamic QoS
	#echo Write priority asset for each HP port
	devmem 0xF800801C 32 0x0
	devmem 0xF800901C 32 0x0
	devmem 0xF800A01C 32 0x0

	#echo Read priority asset for each HP port
	devmem 0xF8008008 32 0x0
	devmem 0xF8009008 32 0x0	
	devmem 0xF800A008 32 0x0

	#echo write channel control using QoS for HP0 and HP2
	devmem 0xF8008014 32 0xF0A
	devmem 0xF800A014 32 0xF0A

	#echo read channel control using QoS for HP0 and HP2
	devmem 0xF8008000 32 0xA
	devmem 0xF800A000 32 0xA

	#SLCR reg for unlock
	devmem 0xf8000008 16 0xDF0D

	#set the DDR to select ARQoS & AWQoS
	devmem 0xf800061C 32 0xA0A0

	#SLCR reg for lock
	devmem 0xf8000004 16 0x767B

	#echo Configured for Dynamic QoS done
elif [ $val -eq 1 ]
then

	#echo Configure for Static QoS

	#echo write channel control using QoS for HP0, HP1 and HP2
	devmem 0xF8008014 32 0xF00
	devmem 0xF800A014 32 0xF00

	#echo read channel control using QoS for HP0, HP1 and HP2
	devmem 0xF8008000 32 0x0
	devmem 0xF800A000 32 0x0

	#echo Write priority asset for each HP port
	devmem 0xF800801C 32 0xF
	devmem 0xF800901C 32 0x1
	devmem 0xF800A01C 32 0xF

	#echo Read priority asset for each HP port
	devmem 0xF8008008 32 0xF
	devmem 0xF8009008 32 0x1	
	devmem 0xF800A008 32 0xF

	#SLCR reg for unlock
	devmem 0xf8000008 16 0xDF0D

	#set the DDR to select ARQoS & AWQoS
	devmem 0xf800061C 32 0x5050

	#SLCR reg for lock
	devmem 0xf8000004 16 0x767B

	#echo Configured for Static QoS done
elif [ $val -eq 0 ]
then
	#echo qos removed start

	devmem 0xF8008014 32 0xF00
	devmem 0xF800A014 32 0xF00

	devmem 0xF800801C 32 0
	devmem 0xF800901C 32 0
	devmem 0xF800A01C 32 0

	devmem 0xF8008000 32 0x0
	devmem 0xF800A000 32 0x0

	devmem 0xF8008008 32 0
	devmem 0xF8009008 32 0
	devmem 0xF800A008 32 0
	
	#SLCR reg for unlock
	devmem 0xf8000008 16 0xDF0D

	#set the DDR to select ARQoS & AWQoS
	devmem 0xf800061C 32 0x0

	#SLCR reg for lock
	devmem 0xf8000004 16 0x767B

	#echo qos removed done
fi
