How does portmap and portdisable work on device-tree?

For example:

&esw {
	mediatek,portmap = <0x2f>;
	mediatek,portdisable = <0x2a>;
};

I'm porting new device to OpenWrt and it boots fine. Everything is working except wan port and openwrt thinks lan2 is the wan port.

Can anyone help me to understand logic of the portmap and portdisable ?